themesberg / flowbite-svelte

Official Svelte components built for Flowbite and Tailwind CSS
https://flowbite-svelte.com
MIT License
1.92k stars 231 forks source link

Dropdown: click outside not working on mobile #1237

Open gregg-cbs opened 3 months ago

gregg-cbs commented 3 months ago

Describe the bug

On a mobile device when tapping away from a dropdown to close it, it does not close.

I have checked this in Safari and Chrome on IOS.

This behavior can be exhibited on the flowbite svelte dropdown page itself. Checked with @JHorlamide

Reproduction

https://flowbite-svelte.com/docs/components/dropdown

Flowbite version and System Info

"flowbite-svelte": "^0.44.22"
masar3141 commented 3 months ago

neither working one Safari for macos here

MrRoyce commented 1 month ago

You can work around this by adding an id to the Dropdown and then closing the popup when an element is clicked with document.getElementById('<Dropdown id>').style.display = 'none';