Skip to content

Stop a tab inside nav-overflow from reopening the More menu - #43095

Open
ump45nose wants to merge 2 commits into
twbs:mainfrom
ump45nose:cursor/fix-43092-tab-overflow-menu-reopen-6a70
Open

ump45nose wants to merge 2 commits into
twbs:mainfrom
ump45nose:cursor/fix-43092-tab-overflow-menu-reopen-6a70

Conversation

@ump45nose

Copy link
Copy Markdown

Description

  • Tab no longer adds .show or sets aria-expanded when it activates a tab inside a menu.
  • The menu toggle still gets .active while it holds the current tab.
  • Deactivating that tab still removes .active from the toggle and closes the menu.

Motivation & Context

A click on a tab inside a nav-overflow More menu switches the pane. Menu auto-close then hides the menu. The tab pane has a transition, so Tab#_toggleMenu runs after that close and puts .show back on .nav-overflow-menu. It also sets aria-expanded="true" on the toggle.

_toggleMenu has toggled .show since the tab ARIA rewrite. Before that rewrite, Tab only added .active to the toggle. The pane transition makes the .show update land after Menu.clearMenus.

This change was prepared with AI assistance (Cursor agent) and reviewed before submission.

The active mark can still be lost when overflow is recalculated on resize. That is a separate bug. This change does not fix it.

Type of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have read the contributing guidelines
  • My code follows the code style of the project (using npm run lint)
  • My change introduces changes to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

Related issues

Fixes #43092

Tests

  • npm run lint: exit 0 (0 errors; remaining warnings are pre-existing)
  • npm run js-typecheck: exit 0
  • npx vitest run ... tab.spec.js nav-overflow.spec.js menu.spec.js: 3 files, 262 tests passed

`_toggleMenu` added `.show` after Menu auto-close. The pane transition
made that update land last, so the nav-overflow More menu opened again.

Keep `.active` on the toggle that holds the current tab. Menu owns
the open state. A tab that leaves the menu still clears the toggle.

Fixes twbs#43092

Co-authored-by: ump45nose <ump45nose@users.noreply.github.com>
@ump45nose
ump45nose requested a review from a team as a code owner October 16, 2026 05:40
@julien-deramond julien-deramond added v6 v6, the main branch bug Something does not work as documented js JavaScript or TypeScript sources and plugins labels Oct 16, 2026

This branch has not been deployed

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

Labels

bug Something does not work as documented js JavaScript or TypeScript sources and plugins v6 v6, the main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tab inside a nav-overflow "More" menu reopens the menu after switching panes

3 participants