From f77fedaaf9aa804c57c10966c874eacf2b39a492 Mon Sep 17 00:00:00 2001 From: Andrew Delamar Date: Wed, 16 Aug 2023 12:12:57 -0400 Subject: [PATCH] Fix chart event sync --- src/trace.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/trace.js b/src/trace.js index 0ebcdc3..ef37ef8 100644 --- a/src/trace.js +++ b/src/trace.js @@ -152,12 +152,19 @@ export default { } + // do not transmit click events to prevent unwanted changing of synced + // charts. We do need to transmit an event to stop zooming on synced + // charts however. + var eventType = e.original.type == "click" ? "mousemove" : e.original.type; + var newEvent = { - type: e.original.type == "click" ? "mousemove" : e.original.type, // do not transmit click events to prevent unwanted changing of synced charts. We do need to transmit a event to stop zooming on synced charts however. + type: eventType, chart: chart, x: xScale.getPixelForValue(e.xValue), y: e.original.y, native: { + // ChartJS filters events to plugins by the event's native type + type: eventType, buttons: buttons }, stop: true