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(() => {
162162
163163 watchEffect (() => {
164164 if (panOnScroll && ! zoomKeyPressed .value && ! userSelectionActive ) {
165- d3Selection
166- .on (' wheel' , (event : WheelEvent ) => {
165+ d3Selection .on (
166+ ' wheel.zoom' ,
167+ (event : WheelEvent ) => {
167168 if (isWrappedWithClass (event , noWheelClassName )) {
168169 return false
169170 }
@@ -190,18 +191,22 @@ onMounted(() => {
190191 const deltaY = panOnScrollMode === PanOnScrollMode .Horizontal ? 0 : event .deltaY * deltaNormalize
191192
192193 d3Zoom .translateBy (d3Selection , - (deltaX / currentZoom ) * panOnScrollSpeed , - (deltaY / currentZoom ) * panOnScrollSpeed )
193- })
194- .on (' wheel.zoom' , null )
194+ },
195+ { passive: false },
196+ )
195197 } else if (typeof d3ZoomHandler !== ' undefined' ) {
196- d3Selection
197- .on (' wheel' , (event : WheelEvent ) => {
198+ d3Selection .on (
199+ ' wheel.zoom' ,
200+ function (event : WheelEvent , d ) {
198201 if (! preventScrolling || isWrappedWithClass (event , noWheelClassName )) {
199202 return null
200203 }
201204
202205 event .preventDefault ()
203- })
204- .on (' wheel.zoom' , d3ZoomHandler )
206+ d3ZoomHandler .call (this , event , d )
207+ },
208+ { passive: false },
209+ )
205210 }
206211 })
207212
You can’t perform that action at this time.
0 commit comments