Skip to content

fix(settings): clear animation fps limit field on blur when invalid (@karnan7) - #8328

Open
karnan7 wants to merge 1 commit into
monkeytypegame:masterfrom
karnan7:fix/fps-limit-blur-reset
Open

fix(settings): clear animation fps limit field on blur when invalid (@karnan7)#8328
karnan7 wants to merge 1 commit into
monkeytypegame:masterfrom
karnan7:fix/fps-limit-blur-reset

Conversation

@karnan7

@karnan7 karnan7 commented Aug 7, 2026

Copy link
Copy Markdown

Description

When you type letters into the animation fps limit input in Firefox, they stay in the box after you click away, as if they had been accepted. They have not been. Nothing stored or validated them, the text is just left behind on screen.

Firefox does not pass the typed letters to our code. For a number input with bad text it reports the value as empty, so the code thinks the field is empty. On blur the handler resets the field to its default, which for this setting is also empty when native is selected. The value did not change, so Solid skips writing it to the input and the letters remain visible.

On blur we now write the field's current value into the input directly, rather than depending on Solid noticing a change.

Tested by hand in Firefox.
Note on tests: jsdom sanitizes the value the same way Firefox does, so this case cannot be reproduced in a unit test. Verified manually instead.

Closes #8326

@Miodec

Miodec commented Aug 14, 2026

Copy link
Copy Markdown
Member

I think a cleaner fix here would be to add a new resetToDefaultIfInvalidOnBlur param to the InputField that works simmilarly to resetToDefaultIfEmptyOnBlur. Then in the blur handler, if that prop is true and state is invalid, reset the value to default. Then ofcourse use the prop for the fps animation limit element.

@Miodec Miodec added the waiting for update Pull requests or issues that require changes/comments before continuing label Aug 14, 2026
@karnan7

karnan7 commented Aug 17, 2026

Copy link
Copy Markdown
Author

I gave this a go, but I don't think it actually fixes the bug. Sharing what I found in case it helps.

The reset already happens today. When you type letters into a number input, Firefox won't hand us the text at all, it just tells us the field is empty. So the value becomes undefined, which the existing resetToDefaultIfEmptyOnBlur check already catches, and the default already gets set. The state is correct both before and after.

The problem is that the box on screen never gets updated. Because of the spread props, Solid compares the old string with the new one, sees "" both times, and skips writing to the input. I logged the writes to be sure: with the new prop, blur still does zero writes.

That's why I went with forcing the write on blur. It's the one moment where the user is done typing and it's safe to touch the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend User interface or web stuff waiting for update Pull requests or issues that require changes/comments before continuing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Animation fps limit setting doesn't reset on blur after entering an invalid value

3 participants