diff options
| author | bobzel <zzzman@gmail.com> | 2023-05-17 16:18:20 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2023-05-17 16:18:20 -0400 |
| commit | da5184d2113935df25633a6015e177a51e88df2f (patch) | |
| tree | 1c252a21568dd563b4adaf455d508e0247c367bc /src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | |
| parent | fb41a1fd07faad49c88b2a8dc48b730a1609b00d (diff) | |
fixed scrolling/panning on fitWidth images. fixed drag/zoom conflicts for overlayDocs that are pannable.
Diffstat (limited to 'src/client/views/collections/collectionSchema/CollectionSchemaView.tsx')
| -rw-r--r-- | src/client/views/collections/collectionSchema/CollectionSchemaView.tsx | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx index 2a68f9b58..1cc48bebe 100644 --- a/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx +++ b/src/client/views/collections/collectionSchema/CollectionSchemaView.tsx @@ -686,6 +686,12 @@ export class CollectionSchemaView extends CollectionSubView() { ); } + onPassiveWheel = (e:WheelEvent) => { + // 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) + if (!this._oldWheel.scrollTop && e.deltaY <= 0) e.preventDefault(); + e.stopPropagation(); + } + _oldWheel:any; @computed get keysDropdown() { return ( <div className="schema-key-search"> @@ -699,16 +705,11 @@ export class CollectionSchemaView extends CollectionSubView() { </div> <div className="schema-key-list" - 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 (!r.scrollTop && e.deltaY <= 0) e.preventDefault(); - e.stopPropagation(); - }, - { passive: false } - ) - }> + ref={r => { + this._oldWheel?.removeEventListener('wheel', this.onPassiveWheel); + this._oldWheel= r; + r?.addEventListener('wheel', this.onPassiveWheel, { passive: false } ); + }}> {this._menuKeys.map(key => ( <div className="schema-search-result" |
