Repository navigation
fix(DateInput): a key that cannot scroll a wheel leaves its step running - #10924
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report🔎 Preview ·
|
| 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
|
AI review status for this pull request.
|
|
/approve-spec 8b2bfb2 |
There was a problem hiding this comment.
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]
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.
8b2bfb2 to
a139f54
Compare
|
/approve-spec a139f54 |
There was a problem hiding this comment.
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:DateInputFR17); 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_KEYScomment restates its name, and the two new header lines inuseScrollSettle.tsrepeat thescrollKeysJSDoc.
[Automated review]
| const COLUMN_SCROLL_KEYS: ReadonlySet<string> = new Set([ | ||
| 'ArrowUp', | ||
| 'ArrowDown', | ||
| 'PageUp', | ||
| 'PageDown', | ||
| 'Home', | ||
| 'End', | ||
| ' ', | ||
| ]); |
There was a problem hiding this comment.
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([' ']);| /** | ||
| * 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. | ||
| */ |
There was a problem hiding this comment.
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.
*/| * A caller can name the keys that scroll its scroller. Then another key, as | ||
| * Tab, leaves the steer running. |
There was a problem hiding this comment.
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.
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
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:DateInputFR17 names the keys that move a sheet wheel: Arrow, Page, Home and End. Tab is not one of them.Smallest restoration
useScrollSteertakes an optional set of the keys that scroll the scroller. Without one, every key ends the steer, as before.Evidence
Wheel.test.tsxfail on main. The wheel commits 11 and then 10.Scope
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:knowledgeandpnpm check:changesetspass. ESLint and Prettier pass on the changed files at this head.