From 8846deb8e8a113065094e08c2b1248cced3e9a69 Mon Sep 17 00:00:00 2001 From: moklick Date: Wed, 20 Sep 2023 16:24:40 +0200 Subject: [PATCH] fix(system): nopan doesn't work when used with panOnScroll --- packages/system/src/xypanzoom/filter.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/system/src/xypanzoom/filter.ts b/packages/system/src/xypanzoom/filter.ts index 232c66af..c0d0addd 100644 --- a/packages/system/src/xypanzoom/filter.ts +++ b/packages/system/src/xypanzoom/filter.ts @@ -59,7 +59,10 @@ export function createFilter({ } // if the target element is inside an element with the nopan class, we prevent panning - if (isWrappedWithClass(event, noPanClassName) && event.type !== 'wheel') { + if ( + isWrappedWithClass(event, noPanClassName) && + ((!panOnScroll && event.type !== 'wheel') || (panOnScroll && event.type === 'wheel')) + ) { return false; }