aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorBob Zeleznik <zzzman@gmail.com>2019-10-08 19:02:35 -0400
committerBob Zeleznik <zzzman@gmail.com>2019-10-08 19:02:35 -0400
commit29cdf0d66df3e38408f69ac8225b4d59397ee2e6 (patch)
treed45b62cb180929cf9cd04415ab6927012f37ccb4 /src/client/views/nodes/FormattedTextBox.tsx
parent121cbc76bf971e688398533b303e32d637265364 (diff)
fixes for text selection in pdfs to be less jumpy and to work through other annotations.
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