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 with asChild loses triggerRef when inside Dialog - React 19 #3293

Open
KieranTH opened this issue Dec 17, 2024 · 0 comments
Open

Popover with asChild loses triggerRef when inside Dialog - React 19 #3293

KieranTH opened this issue Dec 17, 2024 · 0 comments

Comments

@KieranTH
Copy link

Bug report

Current Behavior

When a Popover is rendered inside a Dialog, the Popover Content is hidden when the trigger is set as asChild.

After debugging the rendered components in the Tree and DOM, it seems although the components are being rendered, but the placement is wrong due to the triggerRef not being picked up.

The Root inline styling:

{
    position: fixed;
    left: 0px;
    top: 0px;
    transform: translate(0px, -200%);
    min-width: max-content;
    --radix-popper-transform-origin: ;
    z-index: 50;
}

We can also see that the --radix-popper-transform-origin is also empty, pointing to a lack of ref.

The React Dev Tools show these for the Props of the PopoverContext
image

Where the scope and triggerRef are undefined - We can also see a <ForwardRef/> Component being rendered as a child. This doesn't seem right as React 19 has deprecated forwardRef now.

Expected behavior

PopoverContent should be aligned with trigger.

Your environment

Software Name(s) Version
Radix Package(s) dialog, popover 1.1.2
React n/a 19
Browser Arc/Chrome
Assistive tech
Node n/a
npm/yarn
Operating System
@KieranTH KieranTH changed the title Popover with asChild loses scope and triggerRef when inside Dialog - React 19 Popover with asChild loses triggerRef when inside Dialog - React 19 Dec 17, 2024
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

No branches or pull requests

1 participant