Skip to content

Review 5110

Cindy Zhang edited this page Aug 23, 2026 · 1 revision

#5110 — fix(NumberInput): reject non-numeric characters as you type

freddymeta · open · view on GitHub

Verdict: request-changes

These records predate the Review Presentation format for the most part, so the problem/solution/API/theme-target/breaking slots are only filled where the review itself carried them. Reviews from 2026-08-23 on use the full template.

The review · 2026-08-16

The hard part here is that this is a text field with a pending cycle, so dropping the whole value fights an edit the browser has already made.

In Chromium: value 123, caret after the 1, press a then 9 — it commits 1239. On main you get 1a923, flagged invalid, committing nothing. A visible typo becomes a silently wrong number.

It also eats valid input silently. 42 pasted from a spreadsheet commits 42 on main and does nothing here; same for 1,234 and full-width 123. None reach the aria-invalid and "Invalid number" alert this field already has, so a screen reader gets nothing.

Ideally I'd like to keep that invalid-pending path rather than add a second, silent one. DateInput and TimeInput accept anything and reconcile on blur — do we want per-keystroke blocking here at all?

[Reviewed by Robohands]

Clone this wiki locally