Open
Description
When you start the chart with the pan functionality disabled and later enable it, the pan won't work. All the samples start with pan enabled, which is why it works in those cases.
In the next part, I will reproduce the issue in the simplest way by disabling pan functionality from the start.
Steps to Reproduce
(Apologies for the awkward setup—this was just the easiest way for me to test it)
- Go to the samples page: https://www.chartjs.org/chartjs-plugin-zoom/samples/basic.html.
- Open the F12 developer tools and locate the chunk file
17.49536e53.js
, which runs the basic example. - Navigate to line 24, where the sample code is defined, and change the following piece starting at column 1435:
to
pan: {\n enabled: true,
pan: {\n enabled: false,
- Override the file to ensure the change survives a refresh.
- Refresh the page. Pan functionality is now disabled, but when you toggle it, it won't activate.
aa80856d-407b-448d-87f8-51ae3b9b4792.mp4
Expected Behavior
The pan functionality should activate when toggled after being initially disabled.
Additional Notes
My guess is that this issue might be related to how mouse events are registered.
Also, note that this behavior doesn't occur for other options, like zoom.wheel
; it only happens with the pan functionality.
Metadata
Metadata
Assignees
Labels
No labels