Skip to content

fix(DateInput): a key that cannot scroll a wheel leaves its step running - #10924

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/wheel-step-tab
Nov 10, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/wheel-step-tab

Conversation

@vjeux

@vjeux vjeux commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

User impact

On a busy page, a keyboard user can lose a wheel's step by pressing Tab right after an arrow key. This affects DateInput, TimeInput and DateTimeInput wheels under a mouse. The wheel commits the step's row, then commits the row it was leaving.

Problem and solution fit

  • Why the defect occurs: any key on the column ended the wheel's own scroll toward its row, including Tab, which scrolls nothing in the column.
  • Why it harms the task: with the step ended, the settle commits the row the column still shows, which is the row the key left.
  • Why that matters: the field holds a value the person did not choose, with no sign of the change.

The wheel now names the keys that scroll its column, and only those end its step. The month scroller keeps ending its steer on any key. There, Tab moves focus to another month's Tab stop, and the browser scrolls that month in.

Expected behavior and authority

  • component:DateInput FR17 names the keys that move a sheet wheel: Arrow, Page, Home and End. Tab is not one of them.

Smallest restoration

  • useScrollSteer takes an optional set of the keys that scroll the scroller. Without one, every key ends the steer, as before.
  • The wheel passes ArrowUp, ArrowDown, Page Up, Page Down, Home, End and Space. The month scroller passes none.
  • Touch, wheel and pointer input still end the steer.
  • There is no new public API, visual change or string.

Evidence

  • Reproduction before the change: the new Tab and ArrowLeft cases in Wheel.test.tsx fail on main. The wheel commits 11 and then 10.
  • Result after the change: both pass. The wheel re-aims at 11 and never commits 10.
  • Representative unchanged path: Space on a wheel still ends the step. A Tab from a day still ends the month scroller's steer, so the settle rounds to the month the focus scrolled in. Both cases pass on main and here.
  • The month scroller's path in a browser: ArrowRight on the shown month's last day, then Tab. The focused day stays on screen, and the title names its month. With this PR's first key filter, that case fails in Chromium.
  • Mutation-sensitive proof: the month scroller's Tab case fails with the first key filter, which ended the steer on scroll keys only.

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

The gates ran at fdacf41. This head, a139f54, differs only in the new browser case's page read, which drops a non-null assertion. The MonthScroller spec ran again here.

  • pnpm -F @astryxdesign/core typecheck, pnpm check:knowledge and pnpm check:changesets pass. ESLint and Prettier pass on the changed files at this head.
  • Vitest: the DateInput, DateTimeInput and TimeInput suites, 1,182 passed.
  • Interaction specs at one worker: Wheel, WheelActivation, MonthScroller, MonthScrollerSteps and MonthYearWheels. Chromium: 22 passed, 2 skipped. WebKit with CI's profile: 18 passed, 6 skipped.
  • At this head, the MonthScroller spec: 4 passed in Chromium and 4 in WebKit with CI's profile.
  • Accessibility contracts: WheelRest and DateInputSheetMonthArrowFocus, 13 passed.

@vercel

vercel Bot commented Nov 10, 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 Nov 10, 2026 1:26am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · a139f54

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
DateTimeInput 208.8 kB (+79 B) · 18.7 kB CSS (0) — — · — · —
DateInput · Storybook 187.1 kB (+77 B) · 17.0 kB CSS (0) 5,765 (+16) ✓ · ✓ · ✓
PowerSearch 288.4 kB (+63 B) · 24.1 kB CSS (0) — — · — · —
1 more component
Component Size LoC Visual · A11y · RTL
TimeInput 162.6 kB (+55 B) · 16.0 kB CSS (0) — — · — · —

Package size: @astryxdesign/core 7.22 MB packed (+571 B); no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 29 rows, core 36 rows; run pnpm api:report.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

@astracat-bot

astracat-bot Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 10, 2026, 1:44 AM UTC

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 10, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 8b2bfb2

@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.

Changes requested: the wheel fix holds, but the shared key filter regresses the bottom-sheet calendar.

  • In the bottom-sheet calendar, ArrowRight on a month's last day followed by Tab now leaves keyboard focus on a day outside the scroller, under a title naming an earlier month, because the kept steer scrolls the calendar back away from the pane Tab focused (MonthScroller.tsx:639-651); keep Tab ending the month scroller's steer and cover the path with a browser test.
  • The title and changeset say a key that scrolls nothing no longer ends a wheel's or the month scroller's scroll, but Tab does scroll the month scroller and ArrowLeft or ArrowRight still ends a wheel's step, so narrow the wording to Tab on the sheet wheels or extend the fix.

The new wheel Tab case fails on main and passes here, and the DateInput, DateTimeInput and TimeInput suites pass.

[Automated review]

Comment thread .changeset/tab-keeps-wheel-step.md Resolved
Under a mouse, a wheel's own scroll toward a row ended on any keydown,
so Tab right after an arrow key on a busy page ended the step, and the
settle committed the row the wheel was leaving. The wheel now names
the keys that scroll its column: the up and down arrows, Page Up, Page
Down, Home, End and Space. Another key, as Tab, leaves its step
running.

The month scroller still ends its steer on any key: Tab moves focus to
another month's Tab stop, and the browser scrolls that month in.
@vjeux
vjeux force-pushed the uikit/wheel-step-tab branch from 8b2bfb2 to a139f54 Compare November 10, 2026 01:20
@vjeux vjeux changed the title fix(DateInput): a key that scrolls nothing leaves a wheel's step running fix(DateInput): a key that cannot scroll a wheel leaves its step running Nov 10, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec a139f54

@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.

Approved pending CI: CI has not run on this head yet, because the pull request is still a draft; it runs once the pull request is marked ready for review.

The wheel now keeps its key step through Tab and other keys that do not move the column: the new Tab and ArrowLeft cases fail on main and pass here, and the bottom-sheet calendar behaves as on main after ArrowRight then Tab.

Non-blocking:

  • Miss: ArrowDown or Page Down on a wheel's last enabled row right after a step still ends the step, so a busy page commits the row the step left, as on main (Wheel.tsx:303-311, component:DateInput FR17); a key set holding only Space would close it, since the wheel already prevents those keys and steps by itself.
  • Two added comments could be shorter: the COLUMN_SCROLL_KEYS comment restates its name, and the two new header lines in useScrollSettle.ts repeat the scrollKeys JSDoc.

[Automated review]

Comment on lines +303 to +311
const COLUMN_SCROLL_KEYS: ReadonlySet<string> = new Set([
'ArrowUp',
'ArrowDown',
'PageUp',
'PageDown',
'Home',
'End',
' ',
]);

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.

Non-blocking, and the same on main: the wheel already prevents ArrowUp, ArrowDown, Page Up, Page Down, Home and End and steps by itself (useWheelListbox.ts:66-88), so these keys end the steer only when no row is left in their direction, and then no new step starts. On a starved page, ArrowDown to the last enabled row and then ArrowDown or Page Down commits that row and then the row the step left ([[17], [16]]), while component:DateInput FR17 says such a key commits nothing. A set holding only Space, the one key the column scrolls by itself, keeps every key I tried at [[17]], and the Wheel, DateInputTouch, TimeInput and DateTimeInput suites still pass:

const COLUMN_SCROLL_KEYS: ReadonlySet<string> = new Set([' ']);

Comment on lines +298 to +302
/**
* The keys that scroll a focused column. Tab moves focus out of the column,
* and ArrowLeft and ArrowRight scroll nothing in it, so a step keeps running
* through them.
*/

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.

Non-blocking (INV29): the first sentence restates the constant's name, and the second packs three topics into 23 words. Suggested:

/**
 * Tab moves focus out of the column. ArrowLeft and ArrowRight scroll nothing
 * in it. A step keeps running through these keys.
 */

Comment on lines +57 to +58
* A caller can name the keys that scroll its scroller. Then another key, as
* Tab, leaves the steer running.

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.

Non-blocking (INV29): the file header is already well past 12 lines, and these two lines repeat the scrollKeys JSDoc on useScrollSteer. Consider dropping them.

@vjeux
vjeux marked this pull request as ready for review November 10, 2026 06:05
@cixzhang
cixzhang merged commit 5b0eb0f into meta:main Nov 10, 2026
137 checks passed
@vjeux
vjeux deleted the uikit/wheel-step-tab branch November 10, 2026 06:41

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants