You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a form according to the basic example on the website there is some configuration that leads to multiple and inconsistent updates to form values.
Notice that for the first input, which is set up according to the basic example page, the form value is changed twice and is converted from integer to string.
Further any change on the input should not (need to) lead to 2 updates of the form value.
What is the expected correct behavior?
I'm not sure what the single correct behavior should be. I'm new to Svelte and this form library, but I think that we can at least have some expectations:
The code used in the basic example should trigger an update only once per change
It should not change the type of a value (I'm aware that in HTML all values are strings), so either we always have strings or we use the cast that is implemented in Svelte's bind mechanics.
The text was updated successfully, but these errors were encountered:
Summary
When creating a form according to the basic example on the website there is some configuration that leads to multiple and inconsistent updates to form values.
The change handler updates the form value, but the 2 way binding does that as well.
Furthermore, when testing the results are not consistent:
bind
, the form value is an integer.on:change
, the form value is a numerical string.on:change
is the last one so the form value is a numerical string.Steps to reproduce
Example Project
https://codesandbox.io/s/sleepy-shockley-jns3z9?file=/App.svelte
What is the current bug behavior?
Notice that for the first input, which is set up according to the basic example page, the form value is changed twice and is converted from integer to string.
Further any change on the input should not (need to) lead to 2 updates of the form value.
What is the expected correct behavior?
I'm not sure what the single correct behavior should be. I'm new to Svelte and this form library, but I think that we can at least have some expectations:
bind
mechanics.The text was updated successfully, but these errors were encountered: