Skip to content

fix(NumberInput): a finger held on a stepper no longer selects text - #8202

Closed
vjeux wants to merge 2 commits into
meta:mainfrom
vjeux:uikit/c04-stepper-select
Closed

vjeux wants to merge 2 commits into
meta:mainfrom
vjeux:uikit/c04-stepper-select

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

User impact

On a phone, a finger resting on a NumberInput stepper for about half a second selects text instead of pressing the button: Mobile Safari selects the nearest word, the field's label, opens the edit menu over the field, and the step is lost. On an iPhone 17 Pro simulator (iOS 26.2), 1.0 s and 1.6 s holds on + both selected "Quantity" and stepped nothing. Now the 1.0 s hold steps once, and no hold selects anything.

Problem and solution fit

  • Why it happens: the stepper column allows text selection and the touch callout, so Safari's long-press selection wins over the button.
  • Why it hurts: the edit menu covers the field, and the press is lost.
  • Why it matters: a native iOS stepper never selects text; a held control is a press.

Expected behavior and authority

family:input-fields (current) leaves the stepper end content to NumberInput (AV2); architecture:interaction-modality (current) INV4 requires an operable touch path. No record or doc promises text selection on the steppers.

Smallest restoration

Evidence

iOS 26.2 simulator, Mobile Safari, real touches, main beside this branch. Each panel shows the screen's top, where Safari's magnifier appears, and its bottom, where a keyboard would rise (Safari's address text masked); the page draws a finger ring and a touch clock:

  • Reproduction before the change: the magnifier, then "Quantity" selected and the edit menu; value stays 2.
  • Result after the change: nothing selected; the press steps 2 → 3 at the lift, as a tap does, and no keyboard rises. A 1.6 s hold, past Safari's tap limit, selects nothing and steps nothing.
  • Representative unchanged path: a vertical drag that starts on a stepper still scrolls the page and steps nothing (Safari and Chromium); a tap still steps.
  • Regression test or other mutation-sensitive proof: the computed-style test fails on main.

Scope

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • pnpm vitest run --project ui packages/core/src/NumberInput (324): NumberInput.test.tsx pins the column's WebkitTouchCallout, WebkitUserSelect, userSelect and touch-action in source, which Chromium cannot observe (it reads only the unprefixed property and ignores the callout); deleting either prefixed declaration fails it.
  • pnpm storybook:build, then pnpm exec playwright test NumberInput.stepper-press --config playwright.config.ts --project=chromium (4 tests; the style test fails against main's build). CI's discovery lists it (node .github/scripts/a11y-contract-shard.mjs --shard 1/1).
  • pnpm exec vitest run --project node .github/scripts/ci-test-routing.test.mjs .github/scripts/release-check-workflow.test.mjs (104 tests), on main c743ae0.
  • pnpm -F @astryxdesign/core typecheck; eslint and prettier on the touched files.
  • iOS 26.2 simulator, Mobile Safari, main and this branch, recorded and logged: 1.0 s and 1.6 s holds on +, and a 100 pt drag up from + held still before the lift, so the field stays in view.
  • Paths and their tests: 1.0 s hold (Chromium the stepper column opts out of text selection and double-tap zoom, GIF 1); 1.6 s hold (Chromium a finger held 1.6 s, longer than a tap, selects nothing, GIF 2: Chromium does not select on a long press and still clicks after it, so the simulator recording proves the iOS outcome); drag up (Chromium a vertical drag that starts on a stepper scrolls the page and steps nothing, GIF 3); tap (Chromium a tap on a stepper still steps the value).

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 26, 2026 3:18am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 24, 2026
@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Oct 26, 2026, 4:57 AM UTC

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

NumberInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Entry File (ESM) 502B 502B 0B
Lines of Code 1143 1147 -
Complexity Very High Very High (172) -

Component Size

Component Import before Import after Delta CSS before CSS after Delta
core/NumberInput 55.1KB 55.2KB +23B 10.4KB 10.5KB +40B
core/Pagination 86.8KB 86.8KB +24B 14.8KB 14.8KB +37B
core/PowerSearch 147.2KB 147.2KB +28B 18.1KB 18.2KB +44B

Sizes are gzip. Import counts the JavaScript the import loads eagerly; CSS counts the package stylesheet rules referenced by the modules it can load from its own package, lazily loaded ones included.

Bundle Size Summary

Gzip figures measure each package's entry file, not the code an import pulls in.

Package Entry (ESM) Entry gzip before Entry gzip after Delta
@astryxdesign/core 4.9KB 1.2KB 1.2KB 0B
Package stylesheet Gzip before Gzip after Delta
@astryxdesign/core 33.8KB 33.8KB +22B

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

48 of 502 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 753,933
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,072
RichTextEditor Markdown parity: side by side probe dark 556,900
RichTextEditor Markdown parity: side by side probe light 538,816
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
AppShell With Mobile Nav probe light 217,010
AppShell With Mobile Nav probe dark 216,960
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
AppShell Playground neutral dark 65,198
AppShell Playground neutral light 63,788
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232

and 28 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selection and callout opt-outs restore a working press on iOS Safari, but approval waits on an engineering owner's decision about touch-action: manipulation, which turns off double-tap zoom over the steppers: no current spec covers it and the evidence only shows held presses, so an engineering owner needs to provide or identify the governing spec, recorded by commenting /approve-spec <full head SHA> on this pull request (you can do that yourself as an engineering owner), or the PR can drop it along with the changeset's double-tap sentence. Either way, the new Chromium spec still passes with WebkitUserSelect: 'none' or WebkitTouchCallout: 'none' deleted, because Chromium computes user-select from either spelling and ignores -webkit-touch-callout, so please pin those two declarations the way ContextMenu.test.tsx pins the ContextMenu trigger's.

[Automated review]

WebkitTouchCallout: 'none',
WebkitUserSelect: 'none',
userSelect: 'none',
touchAction: 'manipulation',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

touch-action: manipulation turns off double-tap zoom over the steppers. No current spec covers that, and the PR's evidence only covers held presses, which the selection and callout opt-outs fix. An engineering owner needs to adopt it (for example by commenting /approve-spec <full head SHA>), or this line and the changeset's double-tap sentence can go.

const column = page
.getByRole('button', {name: 'Increment Quantity'})
.locator('..');
await expect(column).toHaveCSS('user-select', 'none');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chromium computes user-select: none from either spelling and drops -webkit-touch-callout, so this stays green if WebkitUserSelect: 'none' or WebkitTouchCallout: 'none' (NumberInput.tsx:163-164) is deleted, even though those are the declarations iOS Safari applies in the shipped CSS. Pinning them the way ContextMenu.test.tsx pins the ContextMenu trigger's would make the fix mutation-sensitive.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned in 8b8aee4: NumberInput.test.tsx asserts WebkitTouchCallout, WebkitUserSelect, userSelect and touch-action in the column's source, and deleting either prefixed declaration fails it. The spec header now says what Chromium can observe. The branch is also rebased on main (c743ae0), so the pr-a11y step finds the ReorderGripPinchZoom spec it runs.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selection and callout opt-outs restore a working held press on iOS Safari, but approval waits on an engineering owner's decision about touch-action: manipulation on the stepper column, which turns off double-tap zoom there and has no governing spec yet: an engineering owner can adopt it by commenting /approve-spec <full head SHA> on this pull request (you can do that yourself as an engineering owner), or the PR can drop it along with the changeset's double-tap sentence. Independently, the new Chromium spec still passes with WebkitUserSelect: 'none' and WebkitTouchCallout: 'none' removed, because Chromium reads the unprefixed user-select and the Storybook build autoprefixes it while the published astryx.css does not, so please add a guard on those two declarations (as ContextMenu.test.tsx does for the ContextMenu trigger) and narrow the spec header to what Chromium can observe. The red pr-a11y check comes from main's newer ReorderGripPinchZoom step, whose spec this branch predates, so a rebase on main should clear it and let the new step run.

[Automated review]

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 24, 2026
In iOS Safari (26.2, measured), a finger resting on a number stepper for about
half a second selected the nearest text, the field's label, and opened the edit
menu over the field; the tap that would have stepped was lost. The stepper
column now opts out of text selection and the touch callout, and takes
touch-action: manipulation, so rapid taps cannot double-tap zoom the page while
pans and pinch-zoom stay the browser's.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selection and callout opt-outs restore a working held press on iOS Safari, and the new source guard covers the two declarations Chromium cannot see. Approval waits on an engineering owner's decision about touch-action: manipulation on the stepper column, which turns off double-tap zoom there and has no governing spec yet: an engineering owner can provide or identify that spec by commenting /approve-spec <full head SHA> on this pull request (you can do that yourself as an engineering owner), or the PR can drop the declaration along with the changeset's double-tap sentence and the matching test expectations. Nothing else blocks this change.

[Automated review]

vjeux added a commit to vjeux/astryx that referenced this pull request Oct 24, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
ci.yml takes main's: main discovers every *.a11y.chromium.spec.ts
(meta#8367), so the NumberInput stepper-press spec needs no step of its own.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The selection and callout opt-outs fix the held-press failure recorded in iOS Safari, and the source guard and Chromium spec cover what CI's browsers can see. Approval waits on an engineering owner's decision, because no current spec covers two things this change adds: spec:AST-094 FR41 suppresses selection only for the press on elements whose hold does something and leaves other elements, such as these steppers, to their own record, which NumberInput does not have, and FR18 gives touch-action: manipulation only to elements with touch recognizers. An engineering owner can adopt both as shipped by commenting /approve-spec <full head SHA> on this pull request (you can do that yourself as an engineering owner), or name the spec claims that govern them. Nothing else blocks this change.

[Automated review]

Comment on lines +165 to +167
WebkitTouchCallout: 'none',
WebkitUserSelect: 'none',
userSelect: 'none',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spec:AST-094 FR41 suppresses selection and the callout only for the press, on elements whose hold does something, and sends any other element to its own record. These steppers' hold does nothing and NumberInput has no record, so these always-on opt-outs need an engineering owner's decision (/approve-spec <full head SHA>) or a claim that governs them.

@vjeux

vjeux commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #8205, so the stepper's touch behavior is decided in one place. This pull request's only change was the stepper column's touch styles (no text selection, no callout, touch-action: manipulation). In #8205 the column carries the stepper's hold: touch-action: manipulation stays on it, and text selection and the callout are suppressed for the held press by spec:AST-094 FR41's hold lock through the gesture host (the press tracker's opt-in for that lock is landing in the gesture line). Its browser spec moved to #8205 too.

@vjeux vjeux closed this Oct 26, 2026
@vjeux
vjeux deleted the uikit/c04-stepper-select branch October 26, 2026 05:24
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 26, 2026
…tracker's selection lock

spec:AST-094 FR41 names a stepper's hold-repeat: its press suppresses
text-selection start and the callout for that press only, lifted at the
lift or a cancel. The stepper's press tracker now passes `lockSelection`
(meta#8336's opt-in), so a held finger no longer selects the field's label in
iOS Safari. The browser lock test runs again, and a jsdom test proves the
column is locked while the finger is down and unlocked at the lift.

The press layer reads the two rows it uses, `UIKIT_PRESS` and
`UIKIT_CLICK`, rather than the whole gesture table (component-style-authoring
INV6). meta#8202 is closed into this pull request, so its changeset folds into
this one's: the hold's changeset says a held finger selects no text.

This branch was successfully deployed

1 active deployment
Preview — 87bcb21a Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant