Skip to content

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
Abilityai:devfrom
jordanallenlewis:fix/4668-grid-pan-native-drag
Open

jordanallenlewis wants to merge 1 commit into
Abilityai:devfrom
jordanallenlewis:fix/4668-grid-pan-native-drag

Conversation

@jordanallenlewis

Copy link
Copy Markdown

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:

  • onCanvasPointerDown clears a non-empty selection once it has decided to pan.
  • @dragstart on the canvas root cancels native drags (text inside an input or textarea keeps its own drag).
  • .fleet-canvas.panning is user-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

  • Bug fix (non-breaking change that fixes an issue)

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 no dragstart and no pointercancel and the selection cleared; pans across zone and tile text and asserts nothing is selected; dispatches dragstart on the tile's images and links and asserts it is cancelled.

  • Reproduced first in headless Chromium against vite dev with a mocked API: with a selection, one dragstart, one pointercancel, 10px of a 60px pan applied; clean canvas: none of those. With the fix: 60 of 60px, no dragstart.

  • Frontend unit suite: 8220 passed. check:tokens passes. Not checked on Safari or Firefox.

Mutation: with FleetGrid.vue restored from dev, all three cases in grid-pan-native-drag.spec.js fail (pan applied 15 of 120px; selection left behind; dragstart not cancelled).

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review
  • My changes generate no new warnings

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant