8000 Popover components (dropdown menu, combobox, etc) don't always close on outside click · Issue #1259 · melt-ui/melt-ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Popover components (dropdown menu, combobox, etc) don't always close on outside click #1259

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

Open
dacobo opened this issue Aug 6, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@dacobo
Copy link
dacobo commented Aug 6, 2024

Describe the bug

When a popper component is open and an outside button is clicked, there are scenarios where the popper stays open. I've been trying to narrow down what causes the issue, and it seems to be related to the conditional rendering of the button being clicked.

I've noticed it also happens in certain scenarios when clicking another Melt control. In my sample below, you can see this when clicking the Combo Box and then the Dropdown Menu.

Reproduction

  1. Expand a popper control
  2. While it's open, click on a button somewhere else on the page
    a. This button must then trigger some change to the state, which then causes said button to be removed from the DOM
  3. The popper will stay open

I've put together a sample demonstrating the problem here: https://www.sveltelab.dev/gsi5tthvo4231ts

(Note: It can take a few seconds before the components become responsive in this Sveltelab)

Logs

No response

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 12th Gen Intel(R) Core(TM) i7-1250U
    Memory: 11.85 GB / 31.63 GB
  Binaries:
    Node: 20.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @melt-ui/svelte: ^0.83.0 => 0.83.0
    @sveltejs/kit: ^2.0.0 => 2.5.20
    svelte: ^4.2.7 => 4.2.18

Severity

annoyance

@dacobo dacobo added the bug Something isn't working label Aug 6, 2024
@RLesser
Copy link
RLesser commented Nov 24, 2024

This happens for me as well, but specifically when clicking a canvas while the combobox is open. If I click a different non-canvas div it closes as expected. When I click the canvas the input field is losing focus so it's definitely recording the click happened, just not closing the dropdown.

@fiioonnn
Copy link
fiioonnn commented Jan 12, 2025

Same for me. When i have multiple dropdowns and one of them is open/active, when i click on a different dropdowns trigger, both dropdowns are open.

@ybonchev
Copy link
ybonchev commented Feb 3, 2025

yep have the same exact thing happening, but it only happens in production, in my local environment it works as it should...weird

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants
0