Skip to content

Commit

Permalink
fix: explicit passive: false for wheel events to prevent warnings on …
Browse files Browse the repository at this point in the history
…console (#856)
  • Loading branch information
kurkle authored Nov 15, 2024
1 parent a1c09c9 commit 7704540
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function addHandler(chart, target, type, handler) {
removeHandler(chart, type);
handlers[type] = (event) => handler(chart, event, options);
handlers[type].target = target;
target.addEventListener(type, handlers[type]);

// `passive: false` for wheel events, to prevent chrome warnings. Use default value for other events.
const passive = type === 'wheel' ? false : undefined;
target.addEventListener(type, handlers[type], {passive});
}

export function mouseMove(chart, event) {
Expand Down

0 comments on commit 7704540

Please sign in to comment.