Skip to content

feat(menu): Add delay before closing nested menu after mouse leave #24476

Open
@mrmokwa

Description

@mrmokwa

Feature Description

Problem

When navigating through nested menu items, we must follow a tight path, otherwise it'll close the nested menu.

Proposed Solution

In the current behavior, after the mouse leave, the menu is closed.
If we add some delay, before closing the nested menu after the mouse leave event, we could leverage from better navigation.

Sugestion

Add an option (matMenuNestedCloseDelay) to change the behavior of closing the nested menu.
When this option is used, it should wait X miliseconds (similar to matTooltipShowDelay) before closing the nested menu after mouse leave.

Also add this option to MatMenuDefaultOptions to allow override this behavior with injection token.

<mat-menu #menu="matMenu" matMenuNestedCloseDelay="300">
     ...
</mat-menu>

Use Case

If I try to selected the 90 days options, througth the smallest path, it closes the nested menu.

Animation

Desired Behavior

Taken from stackoverflow with similar issue.
Animation2

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: material/menufeatureThis issue represents a new feature or feature request rather than a bug or bug fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions