From c1f9ed65a6a1af27dcb57a6c107c521f0c9327f2 Mon Sep 17 00:00:00 2001 From: Jukka Kurkela Date: Wed, 5 May 2021 20:17:37 +0300 Subject: [PATCH] Cancel all chart events while panning or dragging --- src/plugin.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugin.js b/src/plugin.js index 48e1cfd4..6895f044 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -40,11 +40,10 @@ export default { chart.resetZoom = (transition) => resetZoom(chart, transition); }, - beforeEvent(chart, args) { + beforeEvent(chart) { const state = getState(chart); - const type = args.event.type; - if ((type === 'click' || type === 'mouseup') && (state.panning || state.dragging)) { - // cancel the click/mouseup event at pan/zoom end + if (state.panning || state.dragging) { + // cancel any event handling while panning or dragging return false; } },