prevent page bouncing when panOnScroll is enabled #359
This commit is contained in:
@@ -71,6 +71,9 @@ const ZoomPane = ({
|
|||||||
if (panOnScroll) {
|
if (panOnScroll) {
|
||||||
d3Selection
|
d3Selection
|
||||||
.on('wheel', (event: any) => {
|
.on('wheel', (event: any) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopImmediatePropagation();
|
||||||
|
|
||||||
const currentZoom = d3Selection.property('__zoom').k || 1;
|
const currentZoom = d3Selection.property('__zoom').k || 1;
|
||||||
|
|
||||||
d3Zoom.translateBy(
|
d3Zoom.translateBy(
|
||||||
|
|||||||
Reference in New Issue
Block a user