aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorSam Wilkins <samwilkins333@gmail.com>2019-10-08 19:33:58 -0400
committerSam Wilkins <samwilkins333@gmail.com>2019-10-08 19:33:58 -0400
commit12e54a87f3eba2285ecc659f48fc023ccc146c3e (patch)
treef678aebf5b64152246955c36d6e8880ea796476e /src/client/views/nodes/FormattedTextBox.tsx
parent04a881bd949341a1cc6580d72527532df8f5bb8e (diff)
parent29cdf0d66df3e38408f69ac8225b4d59397ee2e6 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web
Diffstat (limited to 'src/client/views/nodes/FormattedTextBox.tsx')
-rw-r--r--src/client/views/nodes/FormattedTextBox.tsx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/views/nodes/FormattedTextBox.tsx b/src/client/views/nodes/FormattedTextBox.tsx
index 86166b0b3..67d1bc42c 100644
--- a/src/client/views/nodes/FormattedTextBox.tsx
+++ b/src/client/views/nodes/FormattedTextBox.tsx
@@ -548,7 +548,7 @@ export class FormattedTextBox extends DocComponent<(FieldViewProps & FormattedTe
let editor = this._editorView;
let ret = findLinkFrag(editor.state.doc.content, editor);
- if (ret.frag.size > 2) {
+ if (ret.frag.size > 2 && ret.start >= 0) {
let selection = TextSelection.near(editor.state.doc.resolve(ret.start)); // default to near the start
if (ret.frag.firstChild) {
selection = TextSelection.between(editor.state.doc.resolve(ret.start + 2), editor.state.doc.resolve(ret.start + ret.frag.firstChild.nodeSize)); // bcz: looks better to not have the target selected