Skip to content

Skip eager number updates that cause field rewrites - #3373

Merged
david-crespo merged 3 commits into
mainfrom
fix/not-too-eager-number-input
Sep 8, 2026
Merged

david-crespo merged 3 commits into
mainfrom
fix/not-too-eager-number-input

Conversation

@fakemonster

Copy link
Copy Markdown
Contributor

When we resolved the number field committing in #3282 to not be so lazy, it became not lazy enough! In particular, min and max values would be applied while a user was still typing, which was far too intrusive. The solution is to check if react-aria would cause any changes to the input value on commit, and only force a commit when it's a true no-op on the input string.

Resolves #3372

When we resolved the number field committing in #3282 to not be so lazy,
it became not lazy enough! In particular, min and max values would be
applied while a user was still typing, which was far too intrusive. The
solution is to check if react-aria would cause any changes to the input
value on commit, and only force a commit when it's a true no-op on the
input string.

Resolves #3372
@vercel

vercel Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
console Ready Ready Preview Sep 8, 2026 9:26pm UTC

Request Review

Chromium runs seem a little flaky here, I imagine this is race
conditions between re-renderings and keystrokes.
These never fail in this way locally so I'm just dancing with CI at this
point.

await input.click()
await userEvent.type(input, '20')
await expect.element(input).toHaveValue('20')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pausing here to check that this is 20 is really just to avoid race conditions. locally, this would fail on chromium if i did userEvent.type(input, '20.1'). the end result would be "201". completely unreproducible irl

This branch was successfully deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Instance: 'Disk size' clamping to 100 GiB for a 10 GiB image, but allowing 20 GiB if we toggle between images

2 participants