Skip to content

Popover nested in Dialog does not open #2180

Closed
@kradical

Description

@kradical

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions