Repository navigation
fix(ui): Grid pan no longer turns into a browser drag when canvas text is selected (#4668) - #4669
Open
jordanallenlewis wants to merge 1 commit into
Open
jordanallenlewis wants to merge 1 commit into
jordanallenlewis wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On the Dashboard Grid, a press on the empty canvas is meant to pan. If any canvas text was selected (a zone stat line, the legend, a label after a double-click), the next press-and-move inside it started the browser's native drag of that selection instead: no-drop cursor,
pointercancel, and the pan stopped. Images and links inside a tile could start a native drag the same way.FleetGrid.vue:onCanvasPointerDownclears a non-empty selection once it has decided to pan.@dragstarton the canvas root cancels native drags (text inside an input or textarea keeps its own drag)..fleet-canvas.panningisuser-select: none, so a pan that sweeps across zone headers and tiles selects nothing.Related Issue
Fixes #4668
Journey Impact
Journey Impact: none: pointer handling of the Grid canvas pan, no user-facing promise changes
Type of Change
Testing
I have tested this locally
New tests added (if applicable)
All existing tests pass
Every new test executes the changed path
e2e/grid-pan-native-drag.spec.js(all three@smoke, no agent needed): selects canvas text, drags the background 120x80 and asserts the whole move was applied with nodragstartand nopointercanceland the selection cleared; pans across zone and tile text and asserts nothing is selected; dispatchesdragstarton the tile's images and links and asserts it is cancelled.Reproduced first in headless Chromium against
vite devwith a mocked API: with a selection, onedragstart, onepointercancel, 10px of a 60px pan applied; clean canvas: none of those. With the fix: 60 of 60px, nodragstart.Frontend unit suite: 8220 passed.
check:tokenspasses. Not checked on Safari or Firefox.Mutation: with
FleetGrid.vuerestored fromdev, all three cases ingrid-pan-native-drag.spec.jsfail (pan applied 15 of 120px; selection left behind;dragstartnot cancelled).Checklist