Skip to content

[menu] Content doesn't close on interaction outside of popup in ShadowRoot #3603

Closed

Description

@rosset-nocpes

Bug report

Current behavior

recording_2025-12-23_21.33.43.mp4

When menu opened (with passed ShadowRoot container to MenuPortal), it doesn't close on interaction outside of popup in ShadowRoot. But when clicking not on the ShadowRoot, it closes.

Expected behavior

The menu should detect that the click occurred outside its own bounds inside ShadowRoot and close automatically.

Activity

  1. added
    status: waiting for maintainer
    on Dec 23, 2025
  2. added
    status: waiting for author
    component: menu
    and removed
    status: waiting for maintainer
    on Dec 24, 2025
  3. atomiks commented on Dec 24, 2025

    @atomiks
    Contributor

    @rosset-nocpes is your shadow root open or closed? Also do you have a reproduction for us using Stackblitz?

    One workaround for closed roots is to ensure the internal backdrop is being rendered on top of the outside-clickable area, covering the shadow root content so that clicks are registered correctly. <Menu.Root modal> (default) does this, but it relies on a particular DOM layout which is affected when appending the portal inside the shadow root, so it may need adjusting

  4. atomiks commented on Dec 24, 2025

    @atomiks
    Contributor

    This preview release version may fix it, can you confirm?

    pnpm i https://pkg.pr.new/@base-ui/react@3605
    "dependencies": {
      "@base-ui/react": "https://pkg.pr.new/@base-ui/react@3605"
    }
  5. rosset-nocpes commented on Dec 24, 2025

    @rosset-nocpes
    Author

    I have ShadowRoot open. The previous version doesn't fix it

  6. added
    status: waiting for maintainer
    and removed
    status: waiting for author
    on Dec 24, 2025
  7. added
    status: waiting for author
    and removed
    status: waiting for maintainer
    on Dec 31, 2025
  8. atomiks commented on Dec 31, 2025

    @atomiks
    Contributor

    We need a Stackblitz or similar reproduction to look into this properly

  9. github-actions commented on Jan 7, 2026

    @github-actions

    Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: menustatus: waiting for author

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions