ZoomPlugin: Clear selection in shared-cursor dashboards during zoom (#76719)

This commit is contained in:
Leon Sorokin 2023-10-17 16:26:31 -05:00 committed by GitHub
parent 16d0aff267
commit 41e3b3bea2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,10 +51,7 @@ export const ZoomPlugin = ({ onZoom, config, withZoomY = false }: ZoomPluginProp
}
config.addHook('setSelect', (u) => {
if (!maybeZoomAction(u.cursor!.event)) {
return;
}
if (maybeZoomAction(u.cursor!.event)) {
if (withZoomY && yDrag) {
if (u.select.height >= MIN_ZOOM_DIST) {
for (let key in u.scales!) {
@ -76,6 +73,9 @@ export const ZoomPlugin = ({ onZoom, config, withZoomY = false }: ZoomPluginProp
const maxX = u.posToVal(u.select.left + u.select.width, 'x');
onZoom({ from: minX, to: maxX });
yZoomed = false;
}
}
}