Skip to content
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

Next: not possible to programmatically deselect range calendar timeframe #1068

Open
floteslof opened this issue Jan 26, 2025 · 0 comments
Open

Comments

@floteslof
Copy link

Describe the bug

There currently is no way to reset a range calendar to an unset state (without any range selected).

If you follow the stackblitz link below and click the "Clear days" button, nothing happens except a Object { start: undefined, end: undefined } message is logged.

I think this functionality should be there because the default state (with value not provided) is also without a selected range.

I delved a bit in the code and believe that the conditions in the $effect are the cause for this problem. The $effect only changes the value if value.start is set, removing the option to completely clear the range.

Image

Reproduction

https://stackblitz.com/edit/github-yjqcum-oef9aoj9?file=src%2Froutes%2F%2Blayout.svelte,src%2Froutes%2F%2Bpage.svelte,src%2Froutes%2Fcalendar.svelte

Logs

System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 7700X 8-Core Processor
    Memory: 11.03 GB / 15.20 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v20.12.2/bin/npm

Severity

annoyance

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

1 participant