-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not update binded number input field with trailing zeros #4687
Comments
You should read this: https://0.30000000000000004.com/ |
For exact representation of input, use |
The issue perhaps doesn't express it well, but if you type When I use the browser inspector to set the element's value to |
@dimfeld I should have done the exact steps. Thank you for adding that, I should have listed the full steps. It think the actual bug is here. It's on the repl line 121. to_number function probably returns the same value for 14.10 as for 14.1.
|
Also edited the issue to have the steps. |
duplicate #4631 |
@pushkine I don't think it's a duplicate because it doesn't have to do with reactive statement, it has to do with the fact that the form won't update if it has a trailing zero on it. |
I might be wrong though, but I think this has more to do with the fact that svelte does not recognize that a change happened between 15.1 and 15.10. Thus thinks the user is still inputing data. |
@pushkine I think you are right. For me using tick does not work, but I think what you wrote on the previous issue is correct. I think for now the work around is to bind to element and manually update it. It might be good to have some documentation around this bug, until it gets it fix. |
So if I go to a version before the fix with the lock line mentioned in #4631 the error does not happen. Previous Working Version Current Version: Also note it does not matter whether I use tick or not. I updated my example to show that. |
Fixed in 3.21.0 - https://svelte.dev/repl/04d21f51f66f4910b6da0d27fe5ce1a0?version=3.21.0 |
Describe the bug
If you bind a value to an input a number input field that has a trailing zero on it. Then update the value, the value in the number input field will not change.
Logs
No bug logs.
To Reproduce
https://svelte.dev/repl/04d21f51f66f4910b6da0d27fe5ce1a0?version=3.20.1
Expected behavior
That the input and variable be in sync regardless of the trailing zeros.
Information about your Svelte project:
Your browser and the version: Chorme version 80
Your operating system: OSX 10.15.3
Svelte version 3.20.1
Rollup
Severity
I want to say medium to severe because I can see a lot of users including myself typing in an extra zero. Any application you build for accounting could cause bugs because of this error.
The text was updated successfully, but these errors were encountered: