fix: reset animation fps limit to native when custom field is cleared on blur#8129
Closed
klfk wants to merge 1 commit into
Closed
fix: reset animation fps limit to native when custom field is cleared on blur#8129klfk wants to merge 1 commit into
klfk wants to merge 1 commit into
Conversation
When a user entered a custom fps limit (e.g. 60), then cleared the
field and clicked away, the setting was not updated — the field stayed
empty and the 'native' button remained inactive.
Root cause: the onBlur validator called form.handleSubmit() with an
empty value, which failed validation ('Must be a number') and silently
did nothing. resetToDefaultIfEmptyOnBlur had no effect because the
form's defaultValues.fpsLimit was already "".
Fix: detect an empty value in onBlur and explicitly reset to native
(fpsLimit = 1000), making the 'native' button go active — which matches
the expected behavior described in the issue.
Fixes monkeytypegame#8119
Contributor
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and also include the author name at the end inside parenthesis. It looks like your proposed title needs to be adjusted. Details: A correct version would look something like: feat: add new feature (@github_username) |
Member
Member
|
duplicate #8130 |
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 #8119
Problem
When a user set a custom animation fps limit (e.g.
60), then cleared the input field and clicked away, nothing happened — thenativebutton stayed inactive, the field stayed empty, and the previous custom value was still in effect (no visual feedback).Root cause: The
onBlurvalidator calledform.handleSubmit()with an empty string, which failed theonChangevalidator ("Must be a number"), soonSubmitwas never called. TheresetToDefaultIfEmptyOnBlurprop had no effect because the form'sdefaultValues.fpsLimitwas""— already empty.Fix
In the
onBlurvalidator, explicitly detect an empty value and callsetfpsLimit(1000)to reset to native, making the native button active and clearing the indicator — which matches the expected behavior described in the issue.Also removed the now-redundant
resetToDefaultIfEmptyOnBlurprop from<InputField>since blur is handled manually.Testing
60in the custom limit field → click away → ✅ saved indicator flashes, native button inactive