Skip to content

Conversation

@Doesntmeananything
Copy link

Addresses: #1722, chakra-ui/ark#2874

📝 Description

Adds support for modal behavior for menu.

⛳️ Current behavior (updates)

Menu doesn't support modality.

🚀 New behavior

The modal property can be set to true for menu, meaning that it will:

  • trap focus within its content
  • block scrolling on the body
  • disable pointer interactions outside the popover
  • hide content behind the popover from screen readers

💣 Is this a breaking change (Yes/No):

No, the property is set to false by default, mirroring the behavior before the change.

📝 Additional Information

The change is largely based on how modality is implemented in the popover.

@changeset-bot
Copy link

changeset-bot bot commented Jan 29, 2026

⚠️ No Changeset found

Latest commit: 90aecba

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
zag-nextjs Ready Ready Preview Jan 29, 2026 0:32am
zag-solid Ready Ready Preview Jan 29, 2026 0:32am
zag-svelte Ready Ready Preview Jan 29, 2026 0:32am
zag-vue Ready Ready Preview Jan 29, 2026 0:32am
zag-website Ready Ready Preview Jan 29, 2026 0:32am

Request Review

@segunadebayo
Copy link
Member

Thanks for this. Please test that nested menu still works as expected when modal

@Doesntmeananything
Copy link
Author

Good call. From my tests, if you set just the parent menu to be modal, it works correctly:

Screencast.From.2026-01-29.19-55-41.mp4

However, there's some weirdness if you set modal: true on submenus - essentially, when moving the pointer over the trigger, the submenu gets constantly opened and closed. Modal submenus don't really seem like a valid use case, but still something to keep in mind:

Screencast.From.2026-01-29.19-58-30.mp4

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

Successfully merging this pull request may close these issues.

2 participants