diff options
author | bobzel <zzzman@gmail.com> | 2023-03-23 08:57:27 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-03-23 08:57:27 -0400 |
commit | f499698f8d8dd10c020f73528918fce41f37b4ff (patch) | |
tree | 4dd78eeac40866d4bdf4d21fc5fdae4ba69546cf /src/client/views/nodes/formattedText/FormattedTextBox.tsx | |
parent | 2a4e86be98ad0f8d4aa4cb09b982d448b542d916 (diff) |
fixed pointer events for doc contents with onClickHanlders to be none when document or contents is selected. fixed stackingView text boxes that are focused to not scroll stackingView.
Diffstat (limited to 'src/client/views/nodes/formattedText/FormattedTextBox.tsx')
-rw-r--r-- | src/client/views/nodes/formattedText/FormattedTextBox.tsx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx index a2c1195cb..ddec86606 100644 --- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx +++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx @@ -1723,6 +1723,8 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FieldViewProps this._ignoreScroll = true; this.layoutDoc._scrollTop = this._scrollRef.current.scrollTop; this._ignoreScroll = false; + e.stopPropagation(); + e.preventDefault(); } } }; @@ -1873,7 +1875,18 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FieldViewProps return styleFromLayoutString?.height === '0px' ? null : ( <div className="formattedTextBox-cont" - onWheel={e => this.props.isContentActive() && e.stopPropagation()} + ref={r => + r?.addEventListener( + 'wheel', // if scrollTop is 0, then don't let wheel trigger scroll on any container (which it would since onScroll won't be triggered on this) + (e: WheelEvent) => { + if (this.isContentActive()) { + if (!NumCast(this.layoutDoc._scrollTop) && e.deltaY <= 0) e.preventDefault(); + e.stopPropagation(); + } + }, + { passive: false } + ) + } style={{ ...(this.props.dontScale ? {} |