Skip to content

Menu: Nested submenu closes unexpectedly when mouse is on the border between TriggerItems #2811

@aono222

Description

@aono222

Description

When I move the mouse cursor from one Menu.TriggerItem to an adjacent Menu.TriggerItem, I expected the first submenu's content to close and the new submenu's content (for the TriggerItem being hovered) to open and stay open.

But the new submenu's content appears for a brief moment and then closes unexpectedly instead.

This issue is particularly noticeable when the mouse cursor is placed exactly on the border (the empty space or gap) between the adjacent TriggerItems.

CleanShot.2025-11-03.at.09.47.45.mp4

Link to Reproduction

https://stackblitz.com/edit/ts7gxkil?file=src%2FApp.tsx

Steps to reproduce

  1. Open the reproduction link above.
  2. Hover over the first Menu.TriggerItem ("Open Recent") to open its submenu content.
  3. Move your mouse cursor directly down from the first Menu.TriggerItem to the second Menu.TriggerItem.
  4. Observe: The second submenu's content flashes open for a moment and then immediately closes.

Chakra UI Version

3.28.0

Browser

Google Chrome

Operating System

  • macOS
  • Windows
  • Linux

Additional Information

The bug occurs not only with gap (from flexbox or grid), but also with padding between TriggerItems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions