-
-
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
bind:valueAsDate #3399
Comments
I am a Svelte newbie and I didn't even realize the date field wasn't coerced into a date. Reading the tutorial I automatically assumed it would coerce all HTML fields correctly. My application mostly worked but started behaving strangely later in the flow. It took me a bit of time to realize it was the date string. Not sure how valuable my input as a newbie is here but I would prefer the principle of least surprise, meaning |
newbie here too, i would prefer if I have worked with frontent for 10+ years and seen lib/frameworks come and go. Many reinvents the wheel and try to do form fields and validation in there own way - it's nothing but annoying to have to learn how to do something yet again. think of it as this: if you where to port your application in a few years to/from svelte. the only thing two frameworks could have in common is if they used as much native functionality as possible Would almost prefer I think you got checkbox right, you bind the numeric inputs should not be treated any differently IMO. |
Closing in favor of #3937. |
Is your feature request related to a problem? Please describe.
date
inputs are a bit awkward to deal with since theirvalue
is aYYYY-MM-DD
string. There is avalueAsDate
property which is more useful, but Svelte doesn't currently use that.Describe the solution you'd like
bind:valueAsDate
orbind:value
, but coercing the value to a date (or rather, usingvalueAsDate
being the scenes forbind:value
on date inputs).Using
bind:value
is arguably better — I'm not sure if there are many situations where the string is more useful. But it would be a breaking change.On the other hand,
number
andrange
inputs already coerce values to numbers. So by usingbind:valueAsDate
but not differentiating betweenbind:value
andbind:valueAsNumber
on numeric inputs, we'd be introducing an inconsistency. Blah.Not sure which is preferable.
How important is this feature to you?
It'd be a nice to have.
The text was updated successfully, but these errors were encountered: