mui / mui/base-ui

[navigation menu] Nested inline submenus don’t reset active value state when keepMounted is enabled

Open
#4,496 2 comments 0 reactions 0 assignees View on GitHub
component: navigation menu
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

# Bug report

## Current behavior

In a nested inline submenu implementation, when the `keepMounted` prop is enabled on the Portal and Content components, the active submenu value state is not reset when navigating between menu levels.

This results in previously active submenus persisting even after the user navigates away and returns, causing inconsistent UI state and unexpected behavior in deeper submenu levels.

## Expected behavior

When navigating between menu levels, the active submenu value state should reset appropriately, even when `keepMounted` is enabled.

Submenus should reflect the correct default or initial state when re-entered, rather than preserving stale active values from prior interactions.

## Reproducible example

[Hover over 'Product' -> 'Design Systems' -> Hover out until the menu is hidden -> Hover over 'Product' again and you'll find 'Design Systems' is still active](https://stackblitz.com/edit/4v8hwphc-rn2ynrnn?file=src%2FApp.tsx)

## Base UI version

v1.3.0

## Which browser are you using?

Chrome

## Which OS are you using?

MacOS

## Which assistive tech are you using (if applicable)?

N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.