Skip to content

Commit

Permalink
fix: fix the issue where map drag interaction cannot be terminated ou…
Browse files Browse the repository at this point in the history
…tside the canvas
  • Loading branch information
xiaoluoHe committed Jan 9, 2025
1 parent fd3d692 commit e580904
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vchart",
"comment": "fix: fix the issue where map drag interaction cannot be terminated outside the canvas, #3650",
"type": "none"
}
],
"packageName": "@visactor/vchart"
}
9 changes: 7 additions & 2 deletions packages/vchart/src/interaction/zoom/zoomable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ export class Zoomable implements IZoomable {
} as unknown as BaseEventParams);
this._zoomableTrigger.pointerId = null;
this._eventObj.off(move, { level: Event_Bubble_Level.chart, source: Event_Source_Type.chart }, mousemove as any);
this._eventObj.off(end, { level: Event_Bubble_Level.chart, source: Event_Source_Type.window }, mouseup as any);
[end, `${end}outside`].forEach(type => {
this._eventObj.off(type, { level: Event_Bubble_Level.chart, source: Event_Source_Type.chart }, mouseup as any);
});

this._eventObj.allow(end);
}, delayTime);

Expand Down Expand Up @@ -502,6 +505,8 @@ export class Zoomable implements IZoomable {
}, delayTime);

this._eventObj.on(move, { level: Event_Bubble_Level.chart, source: Event_Source_Type.chart }, mousemove as any);
this._eventObj.on(end, { level: Event_Bubble_Level.chart, source: Event_Source_Type.chart }, mouseup as any);
[end, `${end}outside`].forEach(type => {
this._eventObj.on(type, { level: Event_Bubble_Level.chart, source: Event_Source_Type.chart }, mouseup as any);
});
}
}

0 comments on commit e580904

Please sign in to comment.