File tree 1 file changed +7
-0
lines changed
packages/vchart/src/interaction/zoom
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,9 @@ export class Zoomable implements IZoomable {
139
139
) {
140
140
return ;
141
141
}
142
+ this . _clearDragEvent ( ) ; // 防止drag 事件被同时触发,状态混乱
143
+ this . _zoomableTrigger . clearScroll ( ) ; // 防止scroll事件被同时触发,状态混乱
144
+
142
145
let extendParams : ReturnType < typeof callback > = { } ;
143
146
if ( callback ) {
144
147
extendParams = callback ( { zoomDelta, zoomX, zoomY } , event ) ;
@@ -259,6 +262,8 @@ export class Zoomable implements IZoomable {
259
262
) {
260
263
return stopBubble ;
261
264
}
265
+ this . _clearDragEvent ( ) ; // 防止drag 同时触发,状态混乱
266
+ this . _zoomableTrigger . clearZoom ( ) ; // 防止zoom同时触发,状态混乱
262
267
263
268
if ( callback ) {
264
269
stopBubble = callback ( { scrollX, scrollY } , event as any ) ;
@@ -483,6 +488,8 @@ export class Zoomable implements IZoomable {
483
488
if ( ! this . _zoomableTrigger . parserDragEvent ( params . event ) ) {
484
489
return ;
485
490
}
491
+ this . _zoomableTrigger . clearZoom ( ) ; // 防止zoom 事件被同时触发, 状态混乱
492
+ this . _zoomableTrigger . clearScroll ( ) ; // 防止 scroll 事件被同时触发, 状态混乱
486
493
const delayType = option ?. delayType ?? 'throttle' ;
487
494
const delayTime = option ?. delayTime ?? 0 ;
488
495
const realTime = option ?. realTime ?? true ;
You can’t perform that action at this time.
0 commit comments