fix(settings): clear animation fps limit field on blur when invalid (@karnan7) - #8328
fix(settings): clear animation fps limit field on blur when invalid (@karnan7)#8328karnan7 wants to merge 1 commit into
Conversation
|
I think a cleaner fix here would be to add a new |
|
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. |
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
nativeis 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