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

Popover nested in Dialog does not open #2180

Closed
kradical opened this issue Jun 1, 2023 · 1 comment · Fixed by #2182
Closed

Popover nested in Dialog does not open #2180

kradical opened this issue Jun 1, 2023 · 1 comment · Fixed by #2182

Comments

@kradical
Copy link

kradical commented Jun 1, 2023

Bug report

Current Behavior

Slightly complicated, but..

  • A Popover who's trigger renders differently based on open state
  • and uses a Portal
  • and is rendered in a Dialog

Does not open when the trigger is clicked. In my minimal reproduction case it only doesn't open on the first click, but in our production application it doesn't open at all. This happens because onOpenChange is being called twice in quick succession.

Expected behavior

The popover should open

Reproducible example

https://codesandbox.io/s/sad-darwin-rvpy1o?file=/src/App.tsx

Suggested solution

Not sure, but it looks possibly introduced by 568fdc5. 🤷 See @robbtraister's comment

Additional context

We recently saw this behaviour when bumping radix-ui versions, specifically popover from ^1.0.5 to ^1.0.6.

Your environment

Software Name(s) Version
Radix Package(s) popover 1.0.6
React n/a 18.2.0
Browser chrome latest
Assistive tech n/a n/a
Node n/a 16.15.1
npm/yarn yarn 3.5.1
Operating System macos 13.4
@robbtraister
Copy link
Contributor

The issue in our app seems to have been caused by the mutationObserver here. I was able to achieve the expected behavior by reverting it locally.

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.

2 participants