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

Datepicker is closing when clicking any of the buttons #1475

Closed
bmanth60 opened this issue Oct 29, 2024 · 0 comments · Fixed by #1476
Closed

Datepicker is closing when clicking any of the buttons #1475

bmanth60 opened this issue Oct 29, 2024 · 0 comments · Fixed by #1476

Comments

@bmanth60
Copy link
Contributor

bmanth60 commented Oct 29, 2024

Describe the bug

When I use the datepicker, clicking on any buttons in the popup is closing my picker prematurely.

Recording.2024-10-29.105542.mp4

I am wondering if this logic is incorrect: https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/datepicker/Datepicker.svelte#L153 since the datepicker widget is not nested within the input, and it shouldn't be: https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/datepicker/Datepicker.svelte#L255

PR #1476 adds a ref to the top level datepicker widget for to check for click outside of the container element rather than the input.

Reproduction

  1. Clone https://github.com/bmanth60/flowbite-svelte-issue-template/tree/bmanth60/patch-91061
  2. Click on the datepicker
  3. Select next month

Flowbite version and System Info

System:
    OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
    CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12900K
    Memory: 11.90 GB / 15.49 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 20.17.0 - ~.nvm/versions/node/v20.17.0/bin/node
    npm: 10.8.2 - ~.nvm/versions/node/v20.17.0/bin/npm
  npmPackages:
    @sveltejs/kit: ^2.0.0 => 2.7.2
    flowbite-svelte: ^0.47.2 => 0.47.2
    svelte: ^5.1.2 => 5.1.2
    vite: ^5.0.3 => 5.4.9
bmanth60 added a commit to bmanth60/flowbite-svelte that referenced this issue Oct 29, 2024
shinokada pushed a commit that referenced this issue Oct 30, 2024
* fix: Fixes clickoutside handler function for issue #1475

* Update src/lib/datepicker/Datepicker.svelte

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

1 participant