Skip to content

Conversation

@yihuiliao
Copy link
Member

@yihuiliao yihuiliao commented Jan 28, 2026

Original issue: RSP Component Milestones (view)

  • Menu does not render a popover if it is already in one (intended for menus to support sibling elements). But we should reset this context in MenuTrigger.

Link to chromatic: https://www.chromatic.com/build?appId=5f0dd5ad2b5fc10022a2e320&number=1104

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Go to the S2 storybook, go to Popover and look for the MenuTrigger story, open the popover and click on the "..." button which should display the menu in a separate popover

🧢 Your Project:

@yihuiliao yihuiliao added the S2 label Jan 28, 2026
@rspbot
Copy link

rspbot commented Jan 28, 2026

@yihuiliao yihuiliao added the Menu label Jan 28, 2026
Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

Just checking, does this also work with a menu inside a parent menu's subdialog?

@yihuiliao
Copy link
Member Author

yihuiliao commented Jan 28, 2026

Just checking, does this also work with a menu inside a parent menu's subdialog?

hmm not sure, i'll have to check

edit: i think it should be fine (i tried it locally). i'm assuming what you're talking about is something like this:

<MenuTrigger>
  <Button />
  <Menu>
    <MenuItem />
    <MenuItem />
    <SubmenuTrigger>
       <MenuItem />
       <Popover> 
          // the subdialog stuff
          <Menu>
            <MenuItem />
          </Menu>
       </Popover>
    </SubmenuTrigger>
  </Menu>
</MenuTrigger>

but if someone is rendering a subdialog, that means they're rendering a popover. so in that case, inPopover is set to true. if a menu is rendered inside of that dialog, then it won't try to recreate the popover. if an action menu is rendered inside of that dialog with a trigger, the menutrigger will overwrite the inPopover context to false and the menu will be rendered with a popover.

@yihuiliao yihuiliao added this pull request to the merge queue Jan 29, 2026
Merged via the queue into main with commit 7d1c780 Jan 29, 2026
30 checks passed
@yihuiliao yihuiliao deleted the menu-regression branch January 29, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants