chartjs-plugin-zoom
chartjs-plugin-zoom copied to clipboard
Drag immediately after pan keeps panning
With every zoom configuration combining drag and pan that I tried, if it does not pass a certain amount of time after having performed a pan action and before starting to draw a drag region, pan keeps active during draw even if its modifier key has been released:

It can be experienced in the basic sample with the following zoom configuration:
const zoomOptions = {
limits: {
x: {min: -200, max: 200, minRange: 50},
y: {min: -200, max: 200, minRange: 50}
},
pan: {
modifierKey: 'shift',
enabled: true,
mode: 'xy',
},
zoom: {
wheel: {
enabled: true,
},
pinch: {
enabled: true
},
drag: {
enabled: true
},
mode: 'xy',
onZoomComplete({chart}) {
// This update is needed to display up to date zoom level in the title.
// Without this, previous zoom level is displayed.
// The reason is: title uses the same beforeUpdate hook, and is evaluated before zoom.
chart.update('none');
}
}
};
This still exists if you zoom at least once. How can i enable just one level of zoom?