Repository navigation
fix(lab): a pinch that starts on a reorder grip zooms the page - #8126
Conversation
ListInput's and TransferList's reorder grips declared touch-action: none, so a pinch whose first or second finger landed on one did nothing. They now declare pinch-zoom: one-finger drags still reorder, and a pinch zooms the page (WCAG 1.4.4), the browser's pointercancel ending the drag.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested: touch-action: pinch-zoom on the Lab reorder grips does restore page zoom over ListInput and TransferList, but one pinch shape still reorders the list. If the first finger slides about 16 px on a grip before the second finger lands, Chromium zooms without firing pointercancel, so the drag carries on through the zoom and the release drops the row at the end of the list (both stories). Please cancel an active pointer reorder when a second pointer goes down, as the menu press model and the BottomSheet fix (#7192) do, and add that slid-first-finger pinch to ReorderGripPinchZoom.a11y.chromium.spec.ts.
[Automated review]
| // A finger on a grip drags its row from the first move, so the grip refuses | ||
| // panning. It still allows pinch-zoom: a pinch whose first finger lands on a | ||
| // grip zooms the page (WCAG 1.4.4); the browser's pointercancel then ends | ||
| // the drag, as it would any drag the browser takes. `touch-action` is read | ||
| // when the touch starts, so the active state keeps the same value. |
There was a problem hiding this comment.
In Chromium this holds only while the first finger has not moved. If it slides about 16 px on the grip before the second finger lands, the browser still zooms but ends both pointers with pointerup, not pointercancel, so the drag commits and drops the row at the end of the list (seen in both ListInput and TransferList; 12 px or less is cancelled as described). Cancelling an active pointer reorder when a second pointer goes down would keep the order regardless of which event the browser sends.
| await touch(cdp, 'touchStart', [first]); | ||
| await sleep(30); | ||
| await touch(cdp, 'touchStart', [first, second]); |
There was a problem hiding this comment.
This pinch never moves the first finger before the second lands, so it misses the case that still reorders. A third case that slides the first finger 16 to 24 px down the grip first, then pinches, and asserts the order is unchanged would cover it.
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsListInput (@astryxdesign/lab) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression46 of 494 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 26 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
…nput and TransferList
There was a problem hiding this comment.
Approval recommended: the second-pointer cancel fixes the slid-first-finger pinch from the last review, so in Chromium phone emulation a pinch that lands a finger on a grip in either list now zooms the page and keeps the order, and a one-finger drag still reorders. Before landing, please rebase on main: pr-a11y fails only at the picker wheel step from main's workflow, whose spec file is not on this branch, while this PR's own step passes.
Optional follow-ups:
- Update the description, which still lists only the
touch-actionchange and says the drag is unchanged. - Consider having the grips ignore a second concurrent pointer: a pinch whose first finger slid on one grip and whose second lands on another row's grip still moves that row, as it does on
main.
[Automated review]
The selected panel is a List with onReorder, its rows ListItems: each row ends with core's reorder handle, an option's isReorderDisabled becomes the row's, and the keys keep working as before. TransferList's own pointer drag, drag preview, grip and keyboard session go. A finger now holds the handle for a moment before it drags (a flick scrolls, a pinch zooms), the rows passed slide out of the way, and onChange runs once on the drop. Reordering pauses while a search filters the panel, so a hidden fixed row cannot move. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder, so a pinch whose first finger slid does not drop the row) goes with that drag: the handle never claims a finger that slides before the hold ends. The pinch spec gains that case for both Lab surfaces.
…r session Each record ends with core List's reorder handle, after Remove, through @astryxdesign/core/List/experimental: a finger holds it a moment then drags (a flick scrolls, a pinch zooms), the records it passes slide out of its way, the list autoscrolls, and the drop springs the record into place; a mouse drags at once; the handle's keys move the record, with Space and Escape to pick it up and put it back. The records keep their fields, status line and add/remove motion. ListInput's own grip, pointer drag, drag preview, keyboard session and View Transition drop go, and with them the shared Lab reorder styles, which nothing uses any more. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder) goes with it: the handle never claims a finger that slides before the hold ends, which the pinch spec checks.
The selected panel is a List with onReorder, its rows ListItems: each row ends with core's reorder handle, named after the option (also under renderOption), an option's isReorderDisabled becomes the row's, and the keys keep working as before. TransferList's own pointer drag, drag preview, grip and keyboard session go. A finger now holds the handle for a moment before it drags (a flick scrolls, a pinch zooms), the rows passed make room (on iOS they slide), a dragged row stays inside its panel, and onChange runs once on the drop. A move writes the shown rows' new order back into their own slots, so a value without an option keeps its place and every move can be undone. Reordering pauses while a search filters the panel, so a hidden fixed row cannot move. Selected rows keep one height and one Remove column, fixed rows included. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder, so a pinch whose first finger slid does not drop the row) goes with that drag: the handle never claims a finger that slides before the hold ends. The pinch spec gains that case for both Lab surfaces.
…r session Each record ends with core List's reorder handle, after Remove, through core's List experimental subpath: a finger holds it a moment then drags (a flick scrolls, a pinch zooms), the records it passes slide out of its way and the drop springs the record into place (the same on every touch screen), the list autoscrolls, and a record stays inside the list; a mouse drags at once without motion; activating the handle opens its moves; the handle's keys move the record (sliding on a touch screen), with Space and Escape to pick it up and put it back. The records keep their fields, status line and add/remove motion. ListInput's own grip, pointer drag, drag preview, keyboard session and View Transition drop go, and with them the shared Lab reorder styles, which nothing uses any more. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder) goes with it: the handle never claims a finger that slides before the hold ends, which the pinch spec checks.
The selected panel is a List with onReorder, its rows ListItems: each row ends with core's reorder handle, named after the option (also under renderOption), an option's isReorderDisabled becomes the row's, and the keys keep working as before. TransferList's own pointer drag, drag preview, grip and keyboard session go. A finger now holds the handle for a moment before it drags (a flick scrolls, a pinch zooms), the rows passed make room (on iOS they slide), a dragged row stays inside its panel, and onChange runs once on the drop. A move writes the shown rows' new order back into their own slots, so a value without an option keeps its place and every move can be undone. Reordering pauses while a search filters the panel, so a hidden fixed row cannot move. Selected rows keep one height and one Remove column, fixed rows included. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder, so a pinch whose first finger slid does not drop the row) goes with that drag: the handle never claims a finger that slides before the hold ends. The pinch spec gains that case for both Lab surfaces.
…r session Each record ends with core List's reorder handle, after Remove, through core's List experimental subpath: a finger holds it a moment then drags (a flick scrolls, a pinch zooms), the records it passes slide out of its way and the drop springs the record into place (the same on every touch screen), the list autoscrolls, and a record stays inside the list; a mouse drags at once without motion; activating the handle opens its moves; the handle's keys move the record (sliding on a touch screen), with Space and Escape to pick it up and put it back. The records keep their fields, status line and add/remove motion. ListInput's own grip, pointer drag, drag preview, keyboard session and View Transition drop go, and with them the shared Lab reorder styles, which nothing uses any more. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder) goes with it: the handle never claims a finger that slides before the hold ends, which the pinch spec checks.
The selected panel is a List with onReorder, its rows ListItems: each row ends with core's reorder handle, named after the option (also under renderOption), an option's isReorderDisabled becomes the row's, and the keys keep working as before. TransferList's own pointer drag, drag preview, grip and keyboard session go. A finger now holds the handle for a moment before it drags (a flick scrolls, a pinch zooms), the rows passed make room (on iOS they slide), a dragged row stays inside its panel, and onChange runs once on the drop. A move writes the shown rows' new order back into their own slots, so a value without an option keeps its place and every move can be undone. Reordering pauses while a search filters the panel, so a hidden fixed row cannot move. Selected rows keep one height and one Remove column, fixed rows included. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder, so a pinch whose first finger slid does not drop the row) goes with that drag: the handle never claims a finger that slides before the hold ends. The pinch spec gains that case for both Lab surfaces.
…r session Each record ends with core List's reorder handle, after Remove, through core's List experimental subpath: a finger holds it a moment then drags (a flick scrolls, a pinch zooms), the records it passes slide out of its way and the drop springs the record into place (the same on every touch screen), the list autoscrolls, and a record stays inside the list; a mouse drags at once without motion; activating the handle opens its moves; the handle's keys move the record (sliding on a touch screen), with Space and Escape to pick it up and put it back. The records keep their fields, status line and add/remove motion. ListInput's own grip, pointer drag, drag preview, keyboard session and View Transition drop go, and with them the shared Lab reorder styles, which nothing uses any more. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder) goes with it: the handle never claims a finger that slides before the hold ends, which the pinch spec checks.
The selected panel is a List with onReorder, its rows ListItems: each row ends with core's reorder handle, named after the option (also under renderOption), an option's isReorderDisabled becomes the row's, and the keys keep working as before. TransferList's own pointer drag, drag preview, grip and keyboard session go. A finger now holds the handle for a moment before it drags (a flick scrolls, a pinch zooms), the rows passed make room (on iOS they slide), a dragged row stays inside its panel, and onChange runs once on the drop. A move writes the shown rows' new order back into their own slots, so a value without an option keeps its place and every move can be undone. Reordering pauses while a search filters the panel, so a hidden fixed row cannot move. Selected rows keep one height and one Remove column, fixed rows included. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder, so a pinch whose first finger slid does not drop the row) goes with that drag: the handle never claims a finger that slides before the hold ends. The pinch spec gains that case for both Lab surfaces.
…r session Each record ends with core List's reorder handle, after Remove, through core's List experimental subpath: a finger holds it a moment then drags (a flick scrolls, a pinch zooms), the records it passes slide out of its way and the drop springs the record into place (the same on every touch screen), the list autoscrolls, and a record stays inside the list; a mouse drags at once without motion; activating the handle opens its moves; the handle's keys move the record (sliding on a touch screen), with Space and Escape to pick it up and put it back. The records keep their fields, status line and add/remove motion. ListInput's own grip, pointer drag, drag preview, keyboard session and View Transition drop go, and with them the shared Lab reorder styles, which nothing uses any more. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder) goes with it: the handle never claims a finger that slides before the hold ends, which the pinch spec checks.
The selected panel is a List with onReorder, its rows ListItems: each row ends with core's reorder handle, named after the option (also under renderOption), an option's isReorderDisabled becomes the row's, and the keys keep working as before. TransferList's own pointer drag, drag preview, grip and keyboard session go. A finger now holds the handle for a moment before it drags (a flick scrolls, a pinch zooms), the rows passed make room (on iOS they slide), a dragged row stays inside its panel, and onChange runs once on the drop. A move writes the shown rows' new order back into their own slots, so a value without an option keeps its place and every move can be undone. Reordering pauses while a search filters the panel, so a hidden fixed row cannot move. Selected rows keep one height and one Remove column, fixed rows included. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder, so a pinch whose first finger slid does not drop the row) goes with that drag: the handle never claims a finger that slides before the hold ends. The pinch spec gains that case for both Lab surfaces.
…r session Each record ends with core List's reorder handle, after Remove, through core's List experimental subpath: a finger holds it a moment then drags (a flick scrolls, a pinch zooms), the records it passes slide out of its way and the drop springs the record into place (the same on every touch screen), the list autoscrolls, and a record stays inside the list; a mouse drags at once without motion; activating the handle opens its moves; the handle's keys move the record (sliding on a touch screen), with Space and Escape to pick it up and put it back. The records keep their fields, status line and add/remove motion. ListInput's own grip, pointer drag, drag preview, keyboard session and View Transition drop go, and with them the shared Lab reorder styles, which nothing uses any more. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder) goes with it: the handle never claims a finger that slides before the hold ends, which the pinch spec checks.
The selected panel is a List with onReorder, its rows ListItems: each row ends with core's reorder handle, named after the option (also under renderOption), an option's isReorderDisabled becomes the row's, and the keys keep working as before. TransferList's own pointer drag, drag preview, grip and keyboard session go. A finger now holds the handle for a moment before it drags (a flick scrolls, a pinch zooms), the rows passed make room (on iOS they slide), a dragged row stays inside its panel, and onChange runs once on the drop. A move writes the shown rows' new order back into their own slots, so a value without an option keeps its place and every move can be undone. Reordering pauses while a search filters the panel, so a hidden fixed row cannot move. Selected rows keep one height and one Remove column, fixed rows included. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder, so a pinch whose first finger slid does not drop the row) goes with that drag: the handle never claims a finger that slides before the hold ends. The pinch spec gains that case for both Lab surfaces.
Each record ends with core List's reorder handle, after Remove, through
core's List reorder modules: a finger holds it a moment then drags (a
flick scrolls, a pinch zooms), the records it passes slide out of its way
and the drop springs the record into place (the same on every touch
screen), the list autoscrolls, and a record stays inside the list; a mouse
drags at once without motion; activating the handle opens its moves; the
handle's keys move the record (sliding on a touch screen), with Space and
Escape to pick it up and put it back. The records keep their fields, status
line and add/remove motion. ListInput's own grip, pointer drag, drag
preview, keyboard session and View Transition drop go, and with them the
shared Lab reorder styles, which nothing uses any more.
Lab reaches the session and its handle through internal workspace imports
of core's List/useListReorder and List/ListReorderHandle module paths, which
Lab's typecheck and declaration build map to core's built types, and which
the Sandbox and docsite resolver (scripts/core-internal-modules.cjs) lists,
as they do for motion and gestures. The Lab-import guard's own fixture named
List/useListReorder as its unlisted example; it now names a made-up path. Core's ListReorderHandle takes an aria-label: a whole
accessible name for a row whose label is not text ("Reorder guest 2").
The guard meta#8126 added to the old drag (a second pointer cancels an active
pointer reorder) goes with it: the handle never claims a finger that
slides before the hold ends, which the pinch spec checks.
The selected panel is a List with onReorder, its rows ListItems: each row ends with core's reorder handle, named after the option (also under renderOption), an option's isReorderDisabled becomes the row's, and the keys keep working as before. TransferList's own pointer drag, drag preview, grip and keyboard session go. A finger now holds the handle for a moment before it drags (a flick scrolls, a pinch zooms), the rows passed make room (on iOS they slide), a dragged row stays inside its panel, and onChange runs once on the drop. A move writes the shown rows' new order back into their own slots, so a value without an option keeps its place and every move can be undone. Reordering pauses while a search filters the panel, so a hidden fixed row cannot move. Selected rows keep one height and one Remove column, fixed rows included. The guard meta#8126 added to the old drag (a second pointer cancels an active pointer reorder, so a pinch whose first finger slid does not drop the row) goes with that drag: the handle never claims a finger that slides before the hold ends. The pinch spec gains that case for both Lab surfaces.
Each record ends with core List's reorder handle, after Remove, through
core's List reorder modules: a finger holds it a moment then drags (a
flick scrolls, a pinch zooms), the records it passes slide out of its way
and the drop springs the record into place (the same on every touch
screen), the list autoscrolls, and a record stays inside the list; a mouse
drags at once without motion; activating the handle opens its moves; the
handle's keys move the record (sliding on a touch screen), with Space and
Escape to pick it up and put it back. The records keep their fields, status
line and add/remove motion. ListInput's own grip, pointer drag, drag
preview, keyboard session and View Transition drop go, and with them the
shared Lab reorder styles, which nothing uses any more.
Lab reaches the session and its handle through internal workspace imports
of core's List/useListReorder and List/ListReorderHandle module paths, which
Lab's typecheck and declaration build map to core's built types, and which
the Sandbox and docsite resolver (scripts/core-internal-modules.cjs) lists,
as they do for motion and gestures. Core's ListReorderHandle takes an aria-label: a whole
accessible name for a row whose label is not text ("Reorder guest 2").
The guard meta#8126 added to the old drag (a second pointer cancels an active
pointer reorder) goes with it: the handle never claims a finger that
slides before the hold ends, which the pinch spec checks.
User impact
Readers who zoom a phone page could not pinch-zoom when a finger landed on a reorder grip in Lab's
ListInputorTransferList. The grips start every row, so a pinch over the list often lands on one.Now the pinch zooms the page and the order stays, whichever finger lands on the grip. A one-finger drag still reorders.
Evidence
Chrome phone emulation, CDP two-finger touch, both Lab stories, zoom after a 2.5× pinch:
iOS 26.2 simulator, Safari, scripted pinch to 2.5× with one finger on the first grip:
touch-actionnonepinch-zoomBefore (main), Mobile Safari: the pinch drags the row and opens a select; no zoom.
After: the same pinch zooms the page.
ReorderGripPinchZoom.a11y.chromium.spec.tsfails 4 of 4 pinch cases against main's Storybook build.Problem and solution fit
touch-action: none(sharedreorderStyles.ts), which refuses pinch-zoom for touches that start there.Expected behavior and authority
spec:AST-020FR1 (current): WCAG 2.2 A and AA, so SC 1.4.4 Resize Text.Smallest restoration
reorderStyles.ts: the grip and its active state declaretouch-action: pinch-zoominstead ofnone. The grip still refuses panning, so a one-finger drag moves its row from the first move, as today. When a pinch starts on a grip, the browser cancels the pointer, which ends the drag as a cancel (the order is kept).No new API, visual change or drag change; UIKit's hold-then-drag claim comes later, with the core List reorder.
Scope
Testing
pnpm exec playwright test packages/lab/src/__tests__/ReorderGripPinchZoom.a11y.chromium.spec.ts --project chromiumagainst main's Storybook build (4 failed, 2 passed) and this branch's build (6 passed).ci.yml;pnpm exec vitest run .github/scripts/ci-test-routing.test.mjs .github/scripts/release-check-workflow.test.mjs: 101 passed.pnpm -F @astryxdesign/core build:css && pnpm -F @astryxdesign/lab build:css, thenpnpm exec vitest run --project node scripts/build-css.test.mjs: 11 passed.pnpm -F @astryxdesign/lab typecheck: the new spec typechecks (the one existing error is inMobileTokenizer.test.tsx, on main too).pnpm check:repo(pre-commit); ESLint and Prettier on the touched files.@astryxdesign/labis private.