File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
packages/core/src/container/Viewport Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -162,8 +162,9 @@ onMounted(() => {
162
162
163
163
watchEffect (() => {
164
164
if (panOnScroll && ! zoomKeyPressed .value && ! userSelectionActive ) {
165
- d3Selection
166
- .on (' wheel' , (event : WheelEvent ) => {
165
+ d3Selection .on (
166
+ ' wheel.zoom' ,
167
+ (event : WheelEvent ) => {
167
168
if (isWrappedWithClass (event , noWheelClassName )) {
168
169
return false
169
170
}
@@ -190,18 +191,22 @@ onMounted(() => {
190
191
const deltaY = panOnScrollMode === PanOnScrollMode .Horizontal ? 0 : event .deltaY * deltaNormalize
191
192
192
193
d3Zoom .translateBy (d3Selection , - (deltaX / currentZoom ) * panOnScrollSpeed , - (deltaY / currentZoom ) * panOnScrollSpeed )
193
- })
194
- .on (' wheel.zoom' , null )
194
+ },
195
+ { passive: false },
196
+ )
195
197
} else if (typeof d3ZoomHandler !== ' undefined' ) {
196
- d3Selection
197
- .on (' wheel' , (event : WheelEvent ) => {
198
+ d3Selection .on (
199
+ ' wheel.zoom' ,
200
+ function (event : WheelEvent , d ) {
198
201
if (! preventScrolling || isWrappedWithClass (event , noWheelClassName )) {
199
202
return null
200
203
}
201
204
202
205
event .preventDefault ()
203
- })
204
- .on (' wheel.zoom' , d3ZoomHandler )
206
+ d3ZoomHandler .call (this , event , d )
207
+ },
208
+ { passive: false },
209
+ )
205
210
}
206
211
})
207
212
You can’t perform that action at this time.
0 commit comments