Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(NumberInput): hide compact steppers on coarse pointers (#8015)

Xinzi Zhoue4b225eb59b9
diff --git a/.changeset/hide-numberinput-s-compact-stepper-buttons-on-co-6epw.md b/.changeset/hide-numberinput-s-compact-stepper-buttons-on-co-6epw.md
new file mode 100644
index 0000000000..c10efe60bb
--- /dev/null
+++ b/.changeset/hide-numberinput-s-compact-stepper-buttons-on-co-6epw.md
@@ -0,0 +1,9 @@
+---
+'@astryxdesign/core': patch
+---
+
+[feat] Adapt NumberInput's compact steppers to primary-pointer precision: hide them on coarse pointers and restore the field's themed end padding. Fine-pointer steppers are unchanged.
+
+Compatibility: this is a non-breaking presentation adaptation. The public props and exports, numeric value and callback contracts, validation, direct entry, and keyboard stepping remain unchanged; existing NumberInput calls require no source or configuration migration. Coarse-pointer users enter the value directly instead of using the compact visual stepper aids.
+
+@imdreamrunner
diff --git a/apps/storybook/stories/NumberInput.stories.tsx b/apps/storybook/stories/NumberInput.stories.tsx
index f2ddd7a254..901a1ea373 100644
--- a/apps/storybook/stories/NumberInput.stories.tsx
+++ b/apps/storybook/stories/NumberInput.stories.tsx
@@ -224,6 +224,14 @@ export const FormattedDisplay: Story = {
};
export const WithNumberSteppers: Story = {
+ parameters: {
+ docs: {
+ description: {
+ story:
+ 'The compact steppers are shown on fine pointers and hidden on coarse pointers, regardless of viewport width. Direct entry and arrow-key stepping remain available.',
+ },
+ },
+ },
render: args => {
const [value, setValue] = useState<number | null>(args.value ?? 2);
return <NumberInput {...args} value={value} onChange={setValue} />;
diff --git a/docs/specs/AST-017/spec.md b/docs/specs/AST-017/spec.md
index ea1dbab28a..ff564fc692 100644
--- a/docs/specs/AST-017/spec.md
+++ b/docs/specs/AST-017/spec.md
@@ -6,8 +6,8 @@ id: spec:AST-017
authority: current
archive_reason: null
superseded_by: null
-approved_by: cixzhang
-approved_at: 2026-10-24
+approved_by: imdreamrunner
+approved_at: 2026-10-29
phase: accepted
owners: [cixzhang, josephfarina]
affects_architecture:
@@ -108,7 +108,8 @@ affects_consumer_docs: [release-process, templates]
"FR60",
"DEC-26",
"DEC-27",
- "DEC-28"
+ "DEC-28",
+ "DEC-30"
]
}
}
@@ -159,9 +160,10 @@ one removal merged ahead of the decision to allow it.
when a valid consumer scenario supported by the latest stable release of a
published package must change source or configuration to keep its code,
interaction, data, semantic output, or supported workflow working, or loses a
- stable public surface. The review names that scenario and the released surface
- it uses. For a surface other than a component, FR54 decides which scenarios are
- valid and supported.
+ stable public surface. FR3's numeric-stepper presentation adaptation is not
+ a stable-surface loss when every condition in that rule holds. The review
+ names the consumer scenario and the released surface it uses. For a surface
+ other than a component, FR54 decides which scenarios are valid and supported.
- **FR2 — Classify against the latest stable release.** A surface added and then
renamed, removed, or reworked before any stable release has no installed
consumer and is not breaking. Private or ignored packages are outside the
@@ -187,6 +189,24 @@ one removal merged ahead of the decision to allow it.
surface and input mode. A change to documented
interaction or accessibility behavior made for accessibility conformance is
classified under FR53.
+
+ Numeric-entry fields MAY hide compact, component-owned auxiliary increment
+ and decrement buttons on coarse primary pointers as a nonbreaking
+ presentation adaptation, even when those buttons are documented and leave
+ the accessibility tree. This narrow rule applies only while existing public
+ props, types, exports, accepted values, validation, submitted values, and
+ numeric callbacks remain unchanged; direct numeric entry remains accessible
+ on the coarse-pointer device; and the field's role, accessible name, value
+ semantics, focusability, and keyboard stepping remain supported. Callers
+ MUST need no source or configuration migration. Non-coarse-pointer steppers
+ remain available, and the component record MUST state the pointer-conditioned
+ availability and verify the preserved entry and stepping contracts. Such an
+ intentional adaptation uses a patch `[feat]` Changeset that describes the
+ buttons' changed availability; it requires no opt-out or deprecation path.
+ This rule does not cover removing a public prop or export, removing an action
+ other than auxiliary numeric stepping, or losing an accessible numeric-entry
+ path. Those changes remain subject to FR1.
+
- **FR4 — Preserved old usage is nonbreaking.** A rename or replacement is
nonbreaking when the old released call, import, option, identifier, or input
continues to work with equivalent meaning through a compatibility alias or
@@ -931,6 +951,7 @@ lands, maintainers apply its requirement in review and release approval.
| FR54 | Changeset classification review against the surface's current record, then the same tier admission every Changeset receives | a CLI correction the CLI record classifies as `[fix]`; a CLI change the CLI record leaves undecided; a CLI change the CLI record classifies as `[breaking]` on a patch plan; a component change | A non-component change is classified by a rule this record restates instead of its surface record, a surface rule turns on risk or adoption, a surface-classified `[breaking]` change ships in a patch or a surface rule makes it patch-eligible, or a component change is classified by a surface record |
| FR59 | Pull request review of fine-pointer before-and-after evidence | a touch change that also fixes a defect fine-pointer users hit; a deliberate cross-device consistency change; a touch-only change; a new fine-pointer look proposed with touch work | A touch change alters fine-pointer behavior or appearance with neither reason, shows no fine-pointer before-and-after evidence, or ships a new fine-pointer look without its own owner decision |
| FR60 | Element counts per story at rest and open, fine and coarse pointer, against architecture INV7 | a surface component at rest; an open layer; a DOM reduction; a recorded exception; an open layer under touch with extra elements | An element beyond INV7's budgets with no recorded owner exception, a hidden twin or second presentation, or a DOM reduction that removes a theme target or documented anatomy, or that is classified as breaking; an open layer more than 5 elements over its fine-pointer count, an added element that is themeable, a new anatomy part, or without a job in its record, or a closed layer, trigger, or repeated component above its fine-pointer count |
+| FR3 | Current component contract, latest-stable inspection, and coarse/non-coarse browser evidence | Auxiliary numeric steppers hidden with accessible direct entry and keyboard stepping retained; lost entry path; removed public prop or essential action | A qualifying numeric-stepper adaptation is labeled breaking, or the narrow rule is used to excuse a lost API, essential action, value/validation/callback contract, or accessible entry path |
## Decision log
@@ -1450,6 +1471,18 @@ implementation tries to use fewer than the allowance.
Rejected: strict parity for layers, with an owner exception for every sheet frame.
+### DEC-30 — Numeric entry does not depend on compact touch steppers
+
+**Reference:** `spec:AST-017/DEC-30`
+**Decider:** `imdreamrunner`, `2026-10-29`
+
+Compact auxiliary numeric steppers may adapt to primary-pointer precision while
+accessible direct entry, numeric contracts, and keyboard stepping remain intact.
+FR3 defines the conditions for patch-compatible adaptation and its limits;
+button visibility is not independently frozen when those conditions hold.
+
+Rejected: classifying every documented auxiliary button's disappearance as breaking despite preserved numeric entry and caller contracts.
+
## Open questions
None.
diff --git a/packages/core/src/NumberInput/NumberInput.doc.mjs b/packages/core/src/NumberInput/NumberInput.doc.mjs
index eb33db907e..45f325779e 100644
--- a/packages/core/src/NumberInput/NumberInput.doc.mjs
+++ b/packages/core/src/NumberInput/NumberInput.doc.mjs
@@ -160,7 +160,7 @@ export const docs = {
name: 'hasNumberSteppers',
type: 'boolean',
description:
- 'Shows increment and decrement buttons at the end of the input.',
+ 'Shows increment and decrement buttons at the end of the input on fine pointers. Hidden on coarse pointers (such as touch screens); text entry and keyboard stepping remain available.',
default: 'false',
},
{
@@ -226,12 +226,14 @@ export const docs = {
{
name: 'containerClassName',
type: 'string',
- description: 'Class name for the field container. Same targeting as `containerXstyle`.',
+ description:
+ 'Class name for the field container. Same targeting as `containerXstyle`.',
},
{
name: 'containerStyle',
type: 'CSSProperties',
- description: 'Inline styles for the field container. Same targeting as `containerXstyle`.',
+ description:
+ 'Inline styles for the field container. Same targeting as `containerXstyle`.',
},
{
name: 'controlXstyle',
@@ -474,7 +476,8 @@ export const docsZh = {
{
name: 'hasNumberSteppers',
type: 'boolean',
- description: '是否在输入框末尾显示递增和递减按钮。',
+ description:
+ '在精细指针设备上于输入框末尾显示递增和递减按钮。粗指针设备(例如触摸屏)上隐藏按钮;仍可直接输入数值或使用键盘步进。',
default: 'false',
},
{
@@ -720,10 +723,12 @@ export const docsDense = {
],
},
propDescriptions: {
- containerXstyle: 'StyleX styles for the field container; no effect in InputGroup or horizontal-labels FormLayout. No root xstyle/className/style.',
+ containerXstyle:
+ 'StyleX styles for the field container; no effect in InputGroup or horizontal-labels FormLayout. No root xstyle/className/style.',
containerClassName: 'Class name for the field container.',
containerStyle: 'Inline styles for the field container.',
- controlXstyle: 'StyleX styles for the visual control box (border, background, icons); not the native input.',
+ controlXstyle:
+ 'StyleX styles for the visual control box (border, background, icons); not the native input.',
controlClassName: 'Class name for the visual control box.',
controlStyle: 'Inline styles for the visual control box.',
label: 'Label text (always rendered for accessibility).',
@@ -754,7 +759,8 @@ export const docsDense = {
'Formats committed value at rest; raw number is shown while editing.',
isWheelEnabled:
'Allow focused wheel gestures to step value. Defaults to true.',
- hasNumberSteppers: 'Show increment + decrement buttons. Defaults to false.',
+ hasNumberSteppers:
+ 'Show increment + decrement buttons on fine pointers; hidden on coarse pointers. Defaults to false.',
units: 'Units suffix (e.g. "%" or "GB").',
isIntegerOnly: 'Only allow integer values.',
hasClear:
diff --git a/packages/core/src/NumberInput/NumberInput.spec.md b/packages/core/src/NumberInput/NumberInput.spec.md
index 8c187c5d4c..65126a1a7c 100644
--- a/packages/core/src/NumberInput/NumberInput.spec.md
+++ b/packages/core/src/NumberInput/NumberInput.spec.md
@@ -6,8 +6,8 @@ id: component:NumberInput
authority: current
archive_reason: null
superseded_by: null
-approved_by: cixzhang
-approved_at: 2026-10-26
+approved_by: imdreamrunner
+approved_at: 2026-10-29
owners: [cixzhang]
review_triggers: [public-api, behavior, layout, theming, accessibility]
verified_by:
@@ -19,6 +19,7 @@ verified_by:
packages/core/src/NumberInput/numberParser.docblock.test.ts,
packages/core/src/NumberInput/__tests__/NumberInput.a11y.test.tsx,
packages/core/src/NumberInput/__tests__/NumberInput.a11y.chromium.spec.ts,
+ packages/core/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts,
packages/core/src/InputGroup/InputGroup.test.tsx,
]
modules: []
@@ -40,15 +41,15 @@ system_specs: [spec:AST-085, spec:AST-086, spec:AST-102]
## Contract at a glance
-| Area | Contract |
-| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| Public contract | None changes. NumberInput is a controlled numeric field with Field props, size, status, `min`, `max`, `step`, `isIntegerOnly`, `formatValue`, `units`, steppers, wheel stepping, clear, disabled and read-only states, and the input-family part props. |
-| Behavior | A text-backed `spinbutton`. Typing edits a draft that commits only on blur or Enter, parsed for the locale and clamped to the range. Arrow keys, the wheel, and the steppers step on a grid and commit at once. |
-| End-user impact | People can type or paste numbers the way their locale and spreadsheets write them, and get told at once when an entry is invalid. Keyboard and screen-reader users can reach a disabled field. Read-only is not announced. |
-| Builder impact | None. |
-| Compatibility/readiness | Records shipped behavior; no API, default, or DOM change. The read-only state is not exposed to assistive technology, and the clear button scales under reduced motion; both are listed under Current-state impact. |
-| Review checks | Reject an `onChange` for every keystroke, a commit of an unparsable draft, a step off the grid or past a bound, a disabled field that leaves the tab order or submits, or arrows that step during IME composition. |
-| Governing rules | `family:input-fields` FR3, FR4, FR8–FR11; `spec:AST-085` FR1–FR3, FR6; `spec:AST-086` FR3, FR4; `architecture:internationalization`; `design:reduced-motion` DR1. |
+| Area | Contract |
+| ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Public contract | NumberInput is a controlled numeric field with Field props, size, status, `min`, `max`, `step`, `isIntegerOnly`, `formatValue`, `units`, steppers, wheel stepping, clear, disabled and read-only states, and input-family part props. |
+| Behavior | A text-backed `spinbutton`; a typed draft commits on blur or Enter, parsed for the locale and clamped to the range. Arrow keys, the wheel, and available non-coarse-pointer steppers step on a grid and commit at once. |
+| End-user impact | Coarse-pointer users enter numbers directly instead of using compact steppers. Keyboard stepping remains available. Invalid entries are announced; disabled fields remain reachable; read-only is not announced. |
+| Builder impact | Public prop types and numeric callbacks remain unchanged; existing NumberInput calls need no source or configuration migration. |
+| Compatibility/readiness | Coarse-pointer adaptation is non-breaking: numeric values, validation, direct entry, and keyboard stepping remain supported. The read-only exposure and reduced-motion clear-button gaps remain listed under Current-state impact. |
+| Review checks | Reject coarse-pointer steppers, loss of non-coarse-pointer steppers when requested, per-keystroke `onChange`, an unparsable commit, an off-grid or out-of-range step, a disabled field that leaves the tab order or submits, or stepping during IME composition. |
+| Governing rules | FR5 and AR4 own pointer-conditioned stepper availability; `family:input-fields` FR3, FR4, FR8–FR11; `spec:AST-085` FR1–FR3, FR6; `spec:AST-086` FR3, FR4; `spec:AST-017` FR1, FR3, FR7; `architecture:internationalization`; `design:reduced-motion` DR1. |
This table is a review projection; the body below is authoritative.
@@ -63,12 +64,16 @@ Consumer usage lives in `NumberInput.doc.mjs`.
- Released default preserved: `yes`; `step={1}`, wheel stepping on, no
steppers, no clear, `size="md"`, `statusVariant="attached"`
-- Compatibility class: records shipped behavior; no public prop, default,
- export, or DOM change
+- Compatibility class: non-breaking presentation adaptation; public prop
+ names, types, exports, numeric values and callbacks, validation, direct entry,
+ and keyboard stepping remain unchanged under `spec:AST-017` FR3's numeric-stepper
+ presentation rule
- Controlled/uncontrolled behavior: controlled only; `value` (`number`, `null`,
or `undefined`) is the committed value, and NumberInput keeps only an
uncommitted text draft of its own
-- Migration decision: none
+- Migration decision: no caller source or configuration migration; numeric
+ input functionality remains available through direct entry and keyboard
+ stepping while compact visual stepper aids adapt to pointer precision
Consumer migration instructions belong in consumer docs and release notes.
@@ -118,7 +123,7 @@ Consumer migration instructions belong in consumer docs and release notes.
| FR2 | Typing changes only a draft; `onChange` is not called while typing. A draft is valid when it parses for the active locale (grouping, decimal separator, digit script, and sign) and, for validity display, lies within the range and meets integer-only. An invalid draft colors the text secondary, sets `aria-invalid`, and fills a persistent assertive region with the localized invalid-number message. | `spec:AST-086` FR3; `architecture:internationalization`; current tests |
| FR3 | On blur the draft resolves once and ends: an empty draft clears (`onChange(null)` when clearable and a value exists) or reverts; an unparsable or wrong-kind draft reverts; otherwise the number clamps to the range and commits with `onChange(number)` when it differs from `value`. Enter resolves a valid draft the same way and clears an empty draft when clearable. Enter commits nothing for an empty draft without `hasClear`, which stays in the field and is not marked invalid, or for an unparsable or wrong-kind draft, which stays in the field and stays invalid. Enter ends the draft only when its commit clamped. In a field that is not disabled, every Enter outside composition then calls `onEnter`, whatever it committed. | Current tests |
| FR4 | ArrowUp and ArrowDown without modifiers, the wheel over the focused input (when `isWheelEnabled`), and the steppers step by one grid position and commit at once. The grid starts at `min` (when it suits integer-only) or 0. From an empty field or an emptied draft, up goes to `min` or 0 and down to `max` or 0. Results round to the finer of the step's and the grid start's precision (at most 12 decimal places), clamp to the range, and never leave integer-only; a stepper that cannot move does nothing, while an arrow or wheel step that cannot move still ends the draft, committing a valid draft's number and dropping an unparsable one. A caller `onKeyDown` that prevents an arrow cancels that step. A wheel step stops the page from scrolling; otherwise the page scrolls. | Current tests |
-| FR5 | With `hasNumberSteppers`, increment and decrement buttons render at the end of the control. They are outside the tab order, are named with the localized increment and decrement phrases and the label, keep focus on the input when pressed, and expose `aria-disabled` when stepping that way cannot move or the field is disabled or read-only. | `spec:AST-085` FR1, FR2; current tests |
+| FR5 | With `hasNumberSteppers`, increment and decrement buttons render at the end of the control unless the primary pointer is coarse. On coarse primary pointers the buttons are hidden from layout and the accessibility tree at every viewport width, with no opt-out; the control restores its normal themed end padding. Direct numeric entry and keyboard stepping remain available. When shown, the buttons are outside the tab order, are named with the localized increment and decrement phrases and the label, keep focus on the input when pressed, and expose `aria-disabled` when stepping that way cannot move or the field is disabled or read-only. | `spec:AST-085` FR1, FR2; current tests |
| FR6 | With `formatValue`, the input shows the formatted committed value at rest and the plain locale-formatted number while focused. The form value is then submitted from a hidden input carrying the raw number, and the visible input has no `name`; without `formatValue` the visible input carries `name`. | Current tests |
| FR7 | `units` renders as secondary text after the input and is part of the input's description. | Current tests |
| FR8 | With `hasClear`, a clear button shows while `value` is not `null` and the field is editable. Activating it calls `onChange(null)`, drops the draft, and focuses the input as TextInput's clear does. The clear button is a ghost small `component:Button`, so its press scale MUST NOT apply under reduced motion (`design:reduced-motion` DR1). Implementation gap: it still scales under reduced motion. | `family:input-fields` FR11; current tests |
@@ -168,19 +173,20 @@ Consumer migration instructions belong in consumer docs and release notes.
- **AR2 — Invalid entry.** FR2's assertive region announces an invalid draft,
since an invalid draft reverts silently on blur (WCAG 3.3.1).
- **AR3 — Disabled.** FR9 satisfies `spec:AST-085` FR1, FR5, and FR6.
-- **AR4 — Steppers.** Pointer-only aids; the arrow keys give keyboard users the
- same stepping (FR4, FR5).
+- **AR4 — Steppers.** Compact pointer-only aids are hidden on coarse primary
+ pointers at every viewport width. Direct numeric entry remains available, and
+ arrow keys provide keyboard stepping on every pointer type (FR4, FR5).
- **AR5 — Read-only exposure.** A read-only NumberInput MUST expose its
read-only state to assistive technology (WCAG 2.2 4.1.2). Implementation gap:
the spinbutton exposes no read-only state.
## Design relationships
-| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
-| ---------------- | --------------------------------------------------------- | ------------------------ | -------------- | ------------------ |
-| Input | Numeric text; secondary color while the draft is invalid. | Current source and tests | Prominent | FR2 |
-| Units | Secondary text after the number. | Current source and tests | Supporting | FR7 |
-| Steppers | Stacked increment and decrement at the end. | Current source and tests | Supporting | FR5, FR13 |
+| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
+| ---------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------ | -------------- | ------------------ |
+| Input | Numeric text; secondary color while the draft is invalid. | Current source and tests | Prominent | FR2 |
+| Units | Secondary text after the number. | Current source and tests | Supporting | FR7 |
+| Steppers | Stacked at the end on non-coarse pointers; hidden on coarse primary pointers, with normal themed end padding. | FR5; DEC-1 | Supporting | FR5, FR13 |
`design:reduced-motion` governs the clear button's press scale (FR8); no other
design record governs NumberInput. The control box carries `number-input`;
@@ -201,19 +207,20 @@ anatomy-theming map.
## Verification map
-| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
-| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
-| FR1, AR1 | `NumberInput.test.tsx` spinbutton-attribute suite; `NumberInput.a11y.chromium.spec.ts` | Bounded, unbounded, formatted | A missing role or ARIA value fails. | `audit:NumberInput/accessibility` |
-| FR2, AR2 | `numberParser.test.ts`; `numberParser.docblock.test.ts`; `NumberInput.test.tsx` invalid-feedback suite | Locales, grouping, invalid text | A misparse, a commit of a guess, or a missing announcement fails. | `audit:NumberInput/behavior` |
-| FR3, ORD1 | `numberInputCommit.test.ts`; `NumberInput.test.tsx` validation, commit-policy, clamping, keyboard-clearing suites | Blur, Enter, empty, clamp, inverted range | A per-keystroke `onChange`, an unclamped commit, or a wrong clear fails. | `audit:NumberInput/behavior` |
-| FR4, FR5, ORD2, AR4, PR1 | `NumberInput.test.tsx` stepping and steppers suites; wheel-listener cases | Keys, wheel, steppers; bounds; empty; precision | A step off the grid, past a bound, or with modifiers fails. Evidence gap: no test steps from an emptied draft over a value. | `audit:NumberInput/behavior` |
-| FR6, FR7 | `NumberInput.test.tsx` formatted-display, form, and units suites | Rest and focus; form submission | A formatted value submitted, or units not described, fails. | `audit:NumberInput/behavior` |
-| FR8 | `NumberInput.test.tsx` hasClear suite | Clear; disabled; read-only | A clear on a disabled field, or no `null`, fails. Evidence gap: no test presses the clear button under reduced motion. | `audit:NumberInput/behavior` |
-| FR9, FR10, ORD3, AR3 | `NumberInput.test.tsx` disabled, disabledMessage, read-only, and form suites; `InputGroup.test.tsx` disabled-propagation cases | Disabled, reason, read-only | A lost tab stop, a submitted disabled value, or stepping while read-only fails. | `audit:NumberInput/accessibility` |
-| FR12 | `NumberInput.fr10.test.tsx`; `NumberInput.test.tsx` status and click-to-focus suites | Standalone and grouped | A base prop off the input, or styling on the wrong part, fails. | `audit:NumberInput/api` |
-| FR13 | `NumberInput.test.tsx` theme-state and stepper-padding suites | Each padding spelling | Steppers that ignore the theme padding fail. | `audit:NumberInput/theming` |
-| AR5 | `NumberInput.a11y.chromium.spec.ts` with its recorded known failure | Read-only | The known failure stops matching when the gap closes. | `audit:NumberInput/accessibility` |
-| FR11 | `NumberInput.test.tsx` "does not step or commit on a composing keydown (IME)" and "waits for IME composition to finish before committing" | Composing arrows and Enter | A step or commit during composition fails. | `audit:NumberInput/behavior` |
+| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
+| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
+| FR1, AR1 | `NumberInput.test.tsx` spinbutton-attribute suite; `NumberInput.a11y.chromium.spec.ts` | Bounded, unbounded, formatted | A missing role or ARIA value fails. | `audit:NumberInput/accessibility` |
+| FR2, AR2 | `numberParser.test.ts`; `numberParser.docblock.test.ts`; `NumberInput.test.tsx` invalid-feedback suite | Locales, grouping, invalid text | A misparse, a commit of a guess, or a missing announcement fails. | `audit:NumberInput/behavior` |
+| FR3, ORD1 | `numberInputCommit.test.ts`; `NumberInput.test.tsx` validation, commit-policy, clamping, keyboard-clearing suites | Blur, Enter, empty, clamp, inverted range | A per-keystroke `onChange`, an unclamped commit, or a wrong clear fails. | `audit:NumberInput/behavior` |
+| FR4, FR5, ORD2, AR4, PR1 | `NumberInput.test.tsx` stepping and steppers suites; wheel-listener cases | Keys, wheel, steppers; bounds; empty; precision | A step off the grid, past a bound, or with modifiers fails. Evidence gap: no test steps from an emptied draft over a value. | `audit:NumberInput/behavior` |
+| FR6, FR7 | `NumberInput.test.tsx` formatted-display, form, and units suites | Rest and focus; form submission | A formatted value submitted, or units not described, fails. | `audit:NumberInput/behavior` |
+| FR8 | `NumberInput.test.tsx` hasClear suite | Clear; disabled; read-only | A clear on a disabled field, or no `null`, fails. Evidence gap: no test presses the clear button under reduced motion. | `audit:NumberInput/behavior` |
+| FR9, FR10, ORD3, AR3 | `NumberInput.test.tsx` disabled, disabledMessage, read-only, and form suites; `InputGroup.test.tsx` disabled-propagation cases | Disabled, reason, read-only | A lost tab stop, a submitted disabled value, or stepping while read-only fails. | `audit:NumberInput/accessibility` |
+| FR12 | `NumberInput.fr10.test.tsx`; `NumberInput.test.tsx` status and click-to-focus suites | Standalone and grouped | A base prop off the input, or styling on the wrong part, fails. | `audit:NumberInput/api` |
+| FR13 | `NumberInput.test.tsx` theme-state and stepper-padding suites | Each padding spelling | Steppers that ignore the theme padding fail. | `audit:NumberInput/theming` |
+| AR5 | `NumberInput.a11y.chromium.spec.ts` with its recorded known failure | Read-only | The known failure stops matching when the gap closes. | `audit:NumberInput/accessibility` |
+| FR11 | `NumberInput.test.tsx` "does not step or commit on a composing keydown (IME)" and "waits for IME composition to finish before committing" | Composing arrows and Enter | A step or commit during composition fails. | `audit:NumberInput/behavior` |
+| FR5, FR13, AR4 | `NumberInput.coarse-pointer.a11y.chromium.spec.ts` | Coarse/non-coarse pointers at 390 and 1280 px, LTR/RTL, non-default themed end padding | Visible coarse-pointer steppers, hidden fine-pointer steppers, wrong end padding, or lost direct/keyboard entry fail. | `audit:NumberInput/behavior` |
## Current-state impact
@@ -235,8 +242,23 @@ anatomy-theming map.
## Decision log
-No component-local decision. NumberInput applies `family:input-fields` and
-`spec:AST-085`.
+NumberInput applies `family:input-fields` and `spec:AST-085`.
+
+### DEC-1 — Compact steppers follow primary-pointer precision
+
+**Reference:** `component:NumberInput/DEC-1`
+**Decider:** `imdreamrunner`, `2026-10-29`
+
+Coarse-primary-pointer presentation uses direct numeric entry rather than
+compact steppers, independently of viewport width and without an opt-out.
+Non-coarse-pointer steppers and keyboard stepping retain their contracts.
+The compact buttons are presentation aids: the numeric value, validation,
+callback, direct-entry, and keyboard-stepping contracts do not depend on their
+visibility. Adapting those aids requires no caller source or configuration
+migration.
+
+Rejected: width-based activation, because pointer precision governs this
+control affordance rather than the available layout width.
## Open questions
diff --git a/packages/core/src/NumberInput/NumberInput.tsx b/packages/core/src/NumberInput/NumberInput.tsx
index ee285dab0c..0c648c36cf 100644
--- a/packages/core/src/NumberInput/NumberInput.tsx
+++ b/packages/core/src/NumberInput/NumberInput.tsx
@@ -5,7 +5,7 @@
/**
* @file NumberInput.tsx
* @input Uses React, useId, useState, useMemo, useCallback, Field, Icon, InputGroupContext
- * @output Exports NumberInput component, NumberInputProps
+ * @output Exports NumberInput component, NumberInputProps; optional steppers are hidden on coarse pointers
* @position Core implementation; consumed by index.ts, tested by NumberInput.test.tsx
*
* SYNC: When modified, update these files to stay in sync:
@@ -100,7 +100,10 @@ const styles = stylex.create({
paddingInlineEnd: padInlineEnd,
},
wrapperWithNumberSteppers: {
- paddingInlineEnd: 0,
+ paddingInlineEnd: {
+ default: 0,
+ '@media (pointer: coarse)': padInlineEnd,
+ },
},
input: {
display: 'block',
@@ -142,7 +145,12 @@ const styles = stylex.create({
},
numberSteppers: {
alignSelf: 'stretch',
- display: 'flex',
+ // These compact buttons are a fine-pointer affordance. Touch users can
+ // enter a value directly; keyboard stepping remains available.
+ display: {
+ default: 'flex',
+ '@media (pointer: coarse)': 'none',
+ },
flexDirection: 'column',
flexShrink: 0,
width: spacingVars['--spacing-4'],
@@ -385,6 +393,8 @@ interface NumberInputPropsBase extends Omit<
isWheelEnabled?: boolean;
/**
* Whether to show increment and decrement buttons at the end of the input.
+ * The buttons are hidden on coarse pointers (such as touch screens).
+ * Direct text entry and keyboard stepping remain available.
* @default false
*/
hasNumberSteppers?: boolean;
diff --git a/packages/core/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts b/packages/core/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts
new file mode 100644
index 0000000000..85457ed677
--- /dev/null
+++ b/packages/core/src/NumberInput/__tests__/NumberInput.coarse-pointer.a11y.chromium.spec.ts
@@ -0,0 +1,102 @@
+// Copyright (c) Meta Platforms, Inc. and affiliates.
+
+/** Real-browser proof of NumberInput's coarse-pointer stepper presentation. */
+
+import {expect, test} from '@playwright/test';
+import {holdMotionStill} from '@astryxdesign/a11y-spec/chromium';
+import {
+ DEFAULT_STORYBOOK_DIR,
+ serveStorybook,
+ type StaticServer,
+} from '@astryxdesign/a11y-spec/storybook';
+
+let storybook: StaticServer;
+
+test.beforeAll(async () => {
+ storybook = await serveStorybook(
+ process.env.ASTRYX_STORYBOOK_DIR ?? DEFAULT_STORYBOOK_DIR,
+ );
+});
+
+test.afterAll(async () => storybook?.close());
+
+for (const width of [390, 1280]) {
+ for (const hasTouch of [false, true]) {
+ test(`${hasTouch ? 'coarse' : 'fine'} pointer at ${width}px preserves entry and the appropriate end padding`, async ({
+ browser,
+ }) => {
+ const context = await browser.newContext({
+ viewport: {width, height: 800},
+ hasTouch,
+ });
+ try {
+ const page = await context.newPage();
+ await page.goto(
+ `${storybook.origin}/iframe.html?id=core-numberinput--with-number-steppers&viewMode=story`,
+ );
+ await holdMotionStill(page);
+ const input = page.getByRole('spinbutton', {name: 'Quantity'});
+ const increment = page.locator(
+ 'button[aria-label="Increment Quantity"]',
+ );
+ const decrement = page.locator(
+ 'button[aria-label="Decrement Quantity"]',
+ );
+ const control = page.locator('.astryx-number-input');
+ await expect(input).toBeVisible();
+ expect(
+ await page.evaluate(() => matchMedia('(pointer: coarse)').matches),
+ ).toBe(hasTouch);
+
+ // Public padding tokens still apply when the compact stepper lane is
+ // hidden. Use a non-default value to catch a hardcoded restoration.
+ await control.evaluate(element => {
+ element.style.setProperty(
+ '--astryx-number-input-padding-inline-end',
+ '20px',
+ );
+ });
+ for (const direction of ['ltr', 'rtl']) {
+ await control.evaluate((element, dir) => {
+ element.setAttribute('dir', dir);
+ }, direction);
+ await expect(control).toHaveCSS('direction', direction);
+ await expect(control).toHaveCSS(
+ 'padding-inline-end',
+ hasTouch ? '20px' : '0px',
+ );
+ if (hasTouch) {
+ await expect(increment).toBeHidden();
+ await expect(decrement).toBeHidden();
+ await expect(
+ page.getByRole('button', {
+ name: /^(Increment|Decrement) Quantity$/,
+ }),
+ ).toHaveCount(0);
+ } else {
+ await expect(increment).toBeVisible();
+ await expect(decrement).toBeVisible();
+ }
+ }
+
+ if (!hasTouch) {
+ await increment.click();
+ await expect(input).toHaveValue('3');
+ await decrement.click();
+ await expect(input).toHaveValue('2');
+ }
+ await input.focus();
+ await input.press('ArrowUp');
+ await expect(input).toHaveValue('3');
+ await input.press('ArrowDown');
+ await expect(input).toHaveValue('2');
+ await input.fill('7');
+ await input.press('Enter');
+ await expect(input).toHaveAttribute('aria-valuenow', '7');
+ await expect(input).toHaveAttribute('inputmode', 'decimal');
+ } finally {
+ await context.close();
+ }
+ });
+ }
+}