Skip to content

Fix nested popover closing PreviewTrigger on hover - #10484

Open
HamedFarazi wants to merge 5 commits into
adobe:mainfrom
HamedFarazi:fix-nested-previewtrigger-popover
Open

Fix nested popover closing PreviewTrigger on hover#10484
HamedFarazi wants to merge 5 commits into
adobe:mainfrom
HamedFarazi:fix-nested-previewtrigger-popover

Conversation

@HamedFarazi

@HamedFarazi HamedFarazi commented Aug 20, 2026

Copy link
Copy Markdown

Closes #10443

Summary

Fixes an issue where a nested Popover opened from inside a PreviewTrigger popover caused the parent PreviewTrigger popover to close when moving the pointer into the nested overlay.

The issue happened because the nested overlay is rendered outside of the PreviewTrigger popover boundary, causing the hover interaction to be interpreted as leaving the preview area.

This change adds regression coverage for nested overlays inside PreviewTrigger and ensures the parent preview remains open while interacting with child overlays.

✅ Pull Request Checklist:

📝 Test Instructions:

Automated tests

Run:

yarn jest packages/react-aria-components/test/PreviewTrigger.test.js

## 🧢 Your Project:
N/A

@github-actions github-actions Bot added the RAC label Aug 20, 2026
// To determine if a popover is a descendant, we check if the pointer is in it AND some element
// within the parent overlay has focus or aria-controls pointing to it.
if (overlayElement) {
let allPopovers = document.querySelectorAll('.react-aria-Popover');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes no one set a custom class name on their popovers so it won't work correctly in many cases. I'm also not sure we want to traverse the DOM to determine this. I think we're gonna want to find a way for useTooltipTriggerState to handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested Popover closes PreviewTrigger when hovered

2 participants