Skip to content

Commit 714dc21

Browse files
committed
fix: fix datazoom drag and zoom triggered at the same time, fix #3819
1 parent cc80a21 commit 714dc21

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/vchart/src/interaction/zoom/zoomable.ts

+3
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ export class Zoomable implements IZoomable {
139139
) {
140140
return;
141141
}
142+
this._clearDragEvent(); // 防止drag 和 zoom 同时触发的问题
143+
142144
let extendParams: ReturnType<typeof callback> = {};
143145
if (callback) {
144146
extendParams = callback({ zoomDelta, zoomX, zoomY }, event);
@@ -483,6 +485,7 @@ export class Zoomable implements IZoomable {
483485
if (!this._zoomableTrigger.parserDragEvent(params.event)) {
484486
return;
485487
}
488+
this._zoomableTrigger.clearZoom(); // 防止drag 和 zoom 同时触发的问题
486489
const delayType = option?.delayType ?? 'throttle';
487490
const delayTime = option?.delayTime ?? 0;
488491
const realTime = option?.realTime ?? true;

0 commit comments

Comments
 (0)