diff options
author | mehekj <mehek.jethani@gmail.com> | 2023-02-09 00:03:40 -0500 |
---|---|---|
committer | mehekj <mehek.jethani@gmail.com> | 2023-02-09 00:03:40 -0500 |
commit | 739fee917e4aa15ff7aef659cc84bfbd3cb48bcf (patch) | |
tree | 96babde1ca9ae32379fabcb29f38360701b42c87 /src/client/views/nodes/formattedText/FormattedTextBox.tsx | |
parent | ca3868b494bfd00c0349424f622bb5010b0e1197 (diff) | |
parent | a8b19694ec902d4094914ba6ddd15e700fab117e (diff) |
Merge branch 'master' into schema-mehek
Diffstat (limited to 'src/client/views/nodes/formattedText/FormattedTextBox.tsx')
-rw-r--r-- | src/client/views/nodes/formattedText/FormattedTextBox.tsx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index 8407eee96..619c59f0e 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -1611,7 +1611,17 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FieldViewProps @action onBlur = (e: any) => { if (this.ProseRef?.children[0] !== e.nativeEvent.target) return; - this.autoLink(); + 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(); + this.autoLink(); + if (this._editorView?.state.tr) { + const tr = stordMarks?.reduce((tr, m) => { + tr.addStoredMark(m); + return tr; + }, this._editorView.state.tr); + tr && this._editorView.dispatch(tr); + } + } FormattedTextBox.Focused === this && (FormattedTextBox.Focused = undefined); if (RichTextMenu.Instance?.view === this._editorView && !this.props.isSelected(true)) { RichTextMenu.Instance?.updateMenu(undefined, undefined, undefined); |