diff options
author | bobzel <zzzman@gmail.com> | 2025-02-11 16:03:29 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-02-11 16:03:29 -0500 |
commit | 3e531aa898492cb05e25081f422bb59adab72e8e (patch) | |
tree | 29f23fa2619cf4d9aca71f455a0e5724c52bd57a /src/client/views/nodes/formattedText/FormattedTextBox.tsx | |
parent | 1ef0a2d7835c9dfa1ec9fc298562f3a052b3e817 (diff) |
enabled multi-select modification of text documents from topBar buttons. fixed diagram box layout and scrolling. fixed problem with createDoc tool where it would fail when it got an array. fixed formatting of chat box errors.
Diffstat (limited to 'src/client/views/nodes/formattedText/FormattedTextBox.tsx')
-rw-r--r-- | src/client/views/nodes/formattedText/FormattedTextBox.tsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 55ad543ca..a6870d65b 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -1694,8 +1694,11 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB setTimeout(() => this.EditorView?.dispatch(this.EditorView.state.tr.setSelection(TextSelection.near(this.EditorView.state.doc.resolve(pos)))), 100); setTimeout(() => (this.ProseRef?.children?.[0] as HTMLElement).focus(), 200); }; + + IsFocused = false; @action onFocused = (e: React.FocusEvent): void => { + this.IsFocused = true; // applyDevTools.applyDevTools(this.EditorView); e.stopPropagation(); }; @@ -1779,6 +1782,16 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB @action onBlur = (e: React.FocusEvent) => { + let ele: HTMLElement | null = e.relatedTarget instanceof HTMLElement ? e.relatedTarget : null; + if (ele?.tabIndex === -1) { + for (; ele; ele = ele?.parentElement) { + if (ele?.className === 'fonticonbox') { + setTimeout(() => this._ref.current?.focus()); + break; + } + } + } + if (ele?.className !== 'fonticonbox') this.IsFocused = false; if (this.ProseRef?.children[0] !== e.nativeEvent.target) return; if (!(this.EditorView?.state.selection instanceof NodeSelection) || this.EditorView.state.selection.node.type !== this.EditorView.state.schema.nodes.footnote) { const stordMarks = this.EditorView?.state.storedMarks?.slice(); |