aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/formattedText/FormattedTextBox.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2021-03-30 13:21:38 -0400
committerbobzel <zzzman@gmail.com>2021-03-30 13:21:38 -0400
commit6e7b3b9ea87a622b7ec8b416b6012d0905ede8ae (patch)
treebfb2e2687f18da704a837438aa5745730a153414 /src/client/views/nodes/formattedText/FormattedTextBox.tsx
parentd998ffa342401e561e551ae8e94aa263cb17a8a3 (diff)
cleaned up more active stuff - renderDepth === 0 no longer triggers contents active. containing view should set isContentsActive=true.
Diffstat (limited to 'src/client/views/nodes/formattedText/FormattedTextBox.tsx')
-rw-r--r--src/client/views/nodes/formattedText/FormattedTextBox.tsx9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index e8dc4bbae..f57a8d91e 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -1238,12 +1238,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
this._editorView && RichTextMenu.Instance?.updateMenu(this._editorView, undefined, this.props);
}
- onPointerWheel = (e: React.WheelEvent): void => {
- // if a text note is selected and scrollable, stop event to prevent, say, outer collection from zooming.
- if ((this.props.rootSelected(true) || this.props.isSelected(true)) || e.currentTarget.scrollHeight > e.currentTarget.clientHeight) {
- e.stopPropagation();
- }
- }
+
onClick = (e: React.MouseEvent): void => {
if (Math.abs(e.clientX - this._downX) > 4 || Math.abs(e.clientY - this._downY) > 4) {
this._forceDownNode = undefined;
@@ -1500,6 +1495,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
const selPaddingClass = selected && !this.layoutDoc._singleLine && margins >= 10 ? "-selected" : "";
return (
<div className="formattedTextBox-cont"
+ onWheel={e => this.isContentActive() && e.stopPropagation()}
style={{
transform: `scale(${scale})`,
transformOrigin: "top left",
@@ -1528,7 +1524,6 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<(FieldViewProp
onPointerUp={this.onPointerUp}
onPointerDown={this.onPointerDown}
onMouseUp={this.onMouseUp}
- onWheel={this.onPointerWheel}
onDoubleClick={this.onDoubleClick}
>
<div className={`formattedTextBox-outer${selected ? "-selected" : ""}`} ref={this._scrollRef}