Fix number input eager clamping on keystrokes#583
Merged
Flaminel merged 2 commits intoApr 25, 2026
Conversation
Move min/max clamping from onInput to onBlur so users can type intermediate values (e.g. "-1", "100") without the field jumping mid-keystroke. The blur handler clamps and syncs the DOM value if needed, then delegates to the existing blurred emitter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Flaminel
reviewed
Apr 25, 2026
- Add braces to single-line if statements in onBlur (style consistency) - Remove manual DOM value sync; signal update triggers change detection and syncs the input display without it Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Thank you very much for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes eager min/max clamping in the
app-number-inputcomponent that interrupted typing mid-keystroke. Previously,onInputcalledMath.max/Math.minon every keystroke, so typing-1would clamp to0after the-, and typing1000would clamp to the max after each digit.The fix moves clamping to
onBlur: the value is clamped and the DOM input synced only when the field loses focus, leaving the user free to type any intermediate value.Related Issue
Closes #581
Type of Change
Testing
-1into Max Ratio, Max Seed Time, and Max Inactive Days fields — no mid-keystroke jumps1000into a field with[max]="999"— value clamped correctly on blurChecklist