Skip to content

Svelte breaks date pickers with bound value #9370

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

Closed
leonklingele opened this issue Nov 3, 2023 · 3 comments
Closed

Svelte breaks date pickers with bound value #9370

leonklingele opened this issue Nov 3, 2023 · 3 comments

Comments

@leonklingele
Copy link

Describe the bug

Svelte seems to mess up input type="date" element behavior having a bound value.

See the reproduction steps for more details.

Reproduction

  1. Head over to https://svelte.dev/repl/hello-world?version=4.2.2 and paste the following snippet:
<script>
	 let value;
</script>

<input type="date" />
<input type="date" bind:value />
  1. Select a random date on both date pickers.
  2. Select the first segment of the first date picker and press the "0" button: The selected segment is set to "00", while the other two segments remain at their previous value. This works as intended across all tested browsers.
  3. Select the first segment of the second date picker (using bind:value) and press the "0" button: All three segments are reset to their default (empty) value. Svelte here seems to change the default browser behavior of date pickers.

Logs

No response

System Info

Severity

annoyance

@dm-de
Copy link

dm-de commented Nov 11, 2023

Yes, here is some "magic". But this is by design.
Svelte make complete value invalid, if here are invalid parts.
But only if you bind value.
Here is also some magic with input type="number".

@tosinek
Copy link

tosinek commented Jan 15, 2024

I logged it some time ago #7897

@dummdidumm
Copy link
Member

Closing as duplicate of #7897

@dummdidumm dummdidumm closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants