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

Popovers close instantly when it is opened while also having another Popover open #3287

Open
1 of 3 tasks
blenderskool opened this issue Feb 6, 2025 · 4 comments
Open
1 of 3 tasks
Labels

Comments

@blenderskool
Copy link

blenderskool commented Feb 6, 2025

Description

When I have multiple Popover like components (Popover, Menu, Select, etc.) and one of them is open, if I try to open another Popover like component, it sometimes instantly closes as soon as it opens. I would expect it to open and only the earlier Popover component to close.

This issue is also visible on Ark UI documentation pages.

Link to Reproduction (or Detailed Explanation)

https://codesandbox.io/p/sandbox/jjpsdc

Steps to Reproduce

  1. Go to https://codesandbox.io/p/sandbox/jjpsdc
  2. Single click on "Menu". Menu should open.
  3. Single click on "Popover". Popover should open and then instantly close. (It might happen after multiple tries)

Ark UI Version

4.9.1

Framework

  • React
  • Solid
  • Vue

Browser

Google Chrome

Additional Information

Recording of reproduction:

popover-issue-1.mov

Recording of reproduction on Ark UI docs page:

popover-issue-2.mov
@blenderskool blenderskool changed the title Popovers closes instantly when it is opened while also having another Popover open Popovers close instantly when it is opened while also having another Popover open Feb 6, 2025
@blenderskool
Copy link
Author

Seems like this issue is in the underlying state machine itself. Tried the Popover example from Zag docs and it appears to have the same issue.

popover-issue-3.mov

@dohaicuong
Copy link

I got another one but might be from a same issue
it's when I use menu on top of modal also experience that instant closing

menu.on.top.of.modal.mp4

@dohaicuong
Copy link

I got another one but might be from a same issue it's when I use menu on top of modal also experience that instant closing

menu.on.top.of.modal.mp4

I just found out my problem is caused by ark-ui Portal, as I change to use react createPortal, the issue gone

@blenderskool
Copy link
Author

I just found out my problem is caused by ark-ui Portal, as I change to use react createPortal, the issue gone

Hmm interesting, I tried it in my reproduction sandbox above and the issue is still there. Maybe your issue was unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants