fix(zooming): allow pinch zoom when preventScrolling=false
This commit is contained in:
@@ -138,7 +138,10 @@ export function createPanOnScrollHandler({
|
|||||||
|
|
||||||
export function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }: ZoomOnScrollParams) {
|
export function createZoomOnScrollHandler({ noWheelClassName, preventScrolling, d3ZoomHandler }: ZoomOnScrollParams) {
|
||||||
return function (this: Element, event: any, d: unknown) {
|
return function (this: Element, event: any, d: unknown) {
|
||||||
if (!preventScrolling || isWrappedWithClass(event, noWheelClassName)) {
|
// we still want to enable pinch zooming even if preventScrolling is set to false
|
||||||
|
const preventZoom = !preventScrolling && event.type === 'wheel' && !event.ctrlKey;
|
||||||
|
|
||||||
|
if (preventZoom || isWrappedWithClass(event, noWheelClassName)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user