Skip to content

feat(NumberInput): a held stepper repeats into the draft and commits once - #8205

Merged
cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c04-stepper-hold
Nov 4, 2026
Merged

cixzhang merged 1 commit into
meta:mainfrom
vjeux:uikit/c04-stepper-hold

Conversation

@vjeux

@vjeux vjeux commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

User need

A stepper moves one step per click, so a far value takes many clicks. A held stepper should keep stepping, without one onChange per value.

Problem and solution fit

  • A mouse or pen press repeats the step from 0.5 s, then every 250 ms, each interval 0.9 of the last, down to 50 ms.
  • Each repeat shows in the field as its draft, without onChange.
  • Release or pointer cancel ends the hold and commits once through onChange. A field that turns disabled or read-only, or steppers that go away, end it with no commit. The pointer click after a release steps nothing; a pointerless click, such as a screen reader's, steps.
  • A press released before 0.5 s is a click; a finger keeps its single step; keyboard stepping is unchanged.

Current specification

component:NumberInput FR5 (steppers) now carries the owner's wording: "Holding a stepper with a mouse or a pen repeats the step, the first repeat after 0.5 s and then faster; each repeated value shows as the field's draft, and the field commits once, through onChange, when the hold ends by release or pointer cancel. A single click steps and commits at once." A verification row names the "a held stepper" suite; the longer FR5 cell re-pads the table (15 whitespace-only rows).

Public delta and caller burden

No new prop, type, default or theme surface. Callers see one onChange per mouse or pen hold.

Design and alternatives

Pointer capture on the two buttons, so a release anywhere ends the hold. Each hold keeps its pointer and draft; a pen's hold takes the shared selection lock. Rejected: a commit per repeat.

Evidence

  • Red first: on main the hold, cancel, bound and no-pointer-click cases fail. The mid-hold editability, steppers-removed, pen-lock and second-pointer cases fail on builds without their guards.
  • Real-Chromium probe, not part of this change ("With number steppers" story): a click goes 2 → 3; a hold reads 3, 4, 6, 7 at 0.3–1.3 s; a release 200 px off the button keeps 7; main stays at 3.

Scope

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Writing rubric results

R1 narration: none; the owner's "as before" was dropped.
R2 research: none in the record.
R3 evidence: the new verification row names the "a held stepper" suite.
R4 rejected alternatives: none in the record.
R5 change references: none.
R6 open questions: none added.

Testing

At c2528eb on main 252b45b:

  • vitest run --project ui packages/core/src/NumberInput packages/core/src/InputGroup: 7 files, 370 tests passed.
  • vitest run --project node packages/cli/foundation/discovery packages/core/src/__tests__: 39 files, 1,005 tests passed.
  • Core tsc --noEmit, pnpm check:knowledge, check:changesets, Prettier and eslint (CI=true) pass. pnpm lint reports only the BaseProps unused-import warning that main already has. pnpm review:pre: 0 findings.

Loading
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