Skip to content

Commit 46926ee

Browse files
authored
Cancel all chart events while panning or dragging (#495)
1 parent 253d01a commit 46926ee

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/plugin.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ export default {
4040
chart.resetZoom = (transition) => resetZoom(chart, transition);
4141
},
4242

43-
beforeEvent(chart, args) {
43+
beforeEvent(chart) {
4444
const state = getState(chart);
45-
const type = args.event.type;
46-
if ((type === 'click' || type === 'mouseup') && (state.panning || state.dragging)) {
47-
// cancel the click/mouseup event at pan/zoom end
45+
if (state.panning || state.dragging) {
46+
// cancel any event handling while panning or dragging
4847
return false;
4948
}
5049
},

0 commit comments

Comments
 (0)