aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-19 14:19:05 -0400
committerbobzel <zzzman@gmail.com>2021-03-19 14:19:05 -0400
commit9bc4d40220bb5bf0b976d5f425457813f6b9981b (patch)
tree48aa15d950c26e0bf839de8a322283d4518d839d /src
parent3e2709a68e32650074e2bbc9af89fa0d66536d77 (diff)
fixed double clicking on text to select text unless near the border. Also allos clicking to set insertion point on isLInkButton text boxes that have been selected.
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index f6fa41145..e83891e42 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -1250,10 +1250,10 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
e.stopPropagation();
return;
}
- this.props.isSelected(true) && ((e.nativeEvent as any).formattedHandled = true);
-
if (this.props.isSelected(true)) { // if text box is selected, then it consumes all click events
- // e.stopPropagation(); // bcz: not sure why this was here. We need to allow the DocumentView to get clicks to process doubleClicks
+ (e.nativeEvent as any).formattedHandled = true
+ if (this.ProseRef?.children[0] !== e.nativeEvent.target) e.stopPropagation(); // if you double click on text, then it will be selected instead of sending a double click to DocumentView & opening a lightbox. Also,if a text box has isLinkButton, this will prevent link following if you've selected the document to edit it.
+ // e.stopPropagation(); // bcz: not sure why this was here. We need to allow the DocumentView to get clicks to process doubleClicks (see above comment)
this.hitBulletTargets(e.clientX, e.clientY, !this._editorView?.state.selection.empty || this._forceUncollapse, false, this._forceDownNode, e.shiftKey);
}
this._forceUncollapse = !(this._editorView!.root as any).getSelection().isCollapsed;