From 5020534fd61f4c77d9e823cc04852b6dd0c90943 Mon Sep 17 00:00:00 2001 From: yipstanley Date: Fri, 12 Jul 2019 18:55:20 -0400 Subject: text box scrolling fix --- src/client/views/nodes/FormattedTextBox.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx index bc36074d2..82c2cef26 100644 --- a/src/client/views/nodes/FormattedTextBox.tsx +++ b/src/client/views/nodes/FormattedTextBox.tsx @@ -350,7 +350,8 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe } } onPointerWheel = (e: React.WheelEvent): void => { - if (this.props.isSelected()) { + // if a text note is not selected and scrollable, this prevents us from being able to scroll and zoom out at the same time + if (this.props.isSelected() || e.currentTarget.scrollHeight > e.currentTarget.clientHeight) { e.stopPropagation(); } } -- cgit v1.2.3-70-g09d2 From 1e79bbb18e54a4408099470c9677b67826db52bb Mon Sep 17 00:00:00 2001 From: yipstanley Date: Fri, 12 Jul 2019 19:23:35 -0400 Subject: backspace no longer deletes things --- src/client/views/GlobalKeyHandler.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client/views/GlobalKeyHandler.ts b/src/client/views/GlobalKeyHandler.ts index 280b13599..037eee55f 100644 --- a/src/client/views/GlobalKeyHandler.ts +++ b/src/client/views/GlobalKeyHandler.ts @@ -6,7 +6,7 @@ import { DragManager } from "../util/DragManager"; import { action } from "mobx"; const modifiers = ["control", "meta", "shift", "alt"]; -type KeyHandler = (keycode: string) => KeyControlInfo; +type KeyHandler = (keycode: string, e: KeyboardEvent) => KeyControlInfo; type KeyControlInfo = { preventDefault: boolean, stopPropagation: boolean @@ -42,7 +42,7 @@ export default class KeyManager { return; } - let control = handleConstrained(keyname); + let control = handleConstrained(keyname, e); control.stopPropagation && e.stopPropagation(); control.preventDefault && e.preventDefault(); @@ -53,7 +53,7 @@ export default class KeyManager { } }); - private unmodified = action((keyname: string) => { + private unmodified = action((keyname: string, e: KeyboardEvent) => { switch (keyname) { case "escape": if (MainView.Instance.isPointerDown) { @@ -69,6 +69,11 @@ export default class KeyManager { break; case "delete": case "backspace": + if (document.activeElement) { + if (document.activeElement.tagName === "INPUT" || document.activeElement.tagName === "TEXTAREA") { + return; + } + } UndoManager.RunInBatch(() => { SelectionManager.SelectedDocuments().map(docView => { let doc = docView.props.Document; -- cgit v1.2.3-70-g09d2 From d75d951a863103568f93ab9b04259d07b9668b47 Mon Sep 17 00:00:00 2001 From: Tyler Schicke Date: Fri, 12 Jul 2019 19:25:20 -0400 Subject: Various small changes/fixes --- src/client/views/MainView.tsx | 8 +++++--- src/client/views/collections/CollectionVideoView.tsx | 2 +- src/client/views/nodes/VideoBox.tsx | 6 ++++-- src/client/views/search/SearchItem.tsx | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/client/views/MainView.tsx b/src/client/views/MainView.tsx index f0e11a480..614b9cce7 100644 --- a/src/client/views/MainView.tsx +++ b/src/client/views/MainView.tsx @@ -1,5 +1,5 @@ import { IconName, library } from '@fortawesome/fontawesome-svg-core'; -import { faArrowDown, faArrowUp, faClone, faCheck, faCommentAlt, faCut, faExclamation, faFilePdf, faFilm, faFont, faGlobeAsia, faPortrait, faMusic, faObjectGroup, faPenNib, faRedoAlt, faTable, faThumbtack, faTree, faUndoAlt } from '@fortawesome/free-solid-svg-icons'; +import { faArrowDown, faArrowUp, faClone, faCheck, faCommentAlt, faCut, faExclamation, faFilePdf, faFilm, faFont, faGlobeAsia, faPortrait, faMusic, faObjectGroup, faPenNib, faRedoAlt, faTable, faThumbtack, faTree, faUndoAlt, faCat } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { action, computed, configure, observable, runInAction, reaction, trace } from 'mobx'; import { observer } from 'mobx-react'; @@ -38,6 +38,7 @@ import { PresentationView } from './presentationview/PresentationView'; import { PreviewCursor } from './PreviewCursor'; import { FilterBox } from './search/FilterBox'; import { CollectionTreeView } from './collections/CollectionTreeView'; +import { ClientUtils } from '../util/ClientUtils'; @observer export class MainView extends React.Component { @@ -111,6 +112,7 @@ export class MainView extends React.Component { library.add(faFont); library.add(faExclamation); library.add(faPortrait); + library.add(faCat); library.add(faFilePdf); library.add(faObjectGroup); library.add(faTable); @@ -378,11 +380,11 @@ export class MainView extends React.Component { let addImportCollectionNode = action(() => Docs.Create.DirectoryImportDocument({ title: "Directory Import", width: 400, height: 400 })); let btns: [React.RefObject, IconName, string, () => Doc][] = [ - [React.createRef(), "portrait", "Add Cat Image", addImageNode], [React.createRef(), "object-group", "Add Collection", addColNode], // [React.createRef(), "clone", "Add Docking Frame", addDockingNode], [React.createRef(), "arrow-up", "Import Directory", addImportCollectionNode], ]; + if (!ClientUtils.RELEASE) btns.unshift([React.createRef(), "cat", "Add Cat Image", addImageNode]); return < div id="add-nodes-menu" style={{ left: this.flyoutWidth + 5 }} > @@ -399,7 +401,7 @@ export class MainView extends React.Component { )} -
  • +