Skip to content

fix: preserve active attribute on menu-bar button while submenu is open#11331

Merged
web-padawan merged 1 commit into
mainfrom
fix/menu-bar-preserve-active
Mar 12, 2026
Merged

fix: preserve active attribute on menu-bar button while submenu is open#11331
web-padawan merged 1 commit into
mainfrom
fix/menu-bar-preserve-active

Conversation

@web-padawan
Copy link
Copy Markdown
Member

Summary

  • Override _setActive() in MenuBarButton to skip deactivation while the button has the expanded attribute, preserving the pressed visual state while the sub-menu is open
  • Fixes keyboard (Enter/Space) and mouse click interactions where ActiveMixin listeners were removing the active attribute immediately after _setExpanded() set it

Fixes #11315

Test plan

  • Added tests verifying active attribute is preserved when opening submenu via Enter, Space, and click
  • Added test verifying active attribute is removed when submenu closes
  • All existing menu-bar tests pass (180/180)

🤖 Generated with Claude Code

…en (#11315)

Override _setActive() in MenuBarButton to skip deactivation while the
button has the expanded attribute, so the pressed visual state remains
while the sub-menu is open.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@web-padawan web-padawan removed the request for review from tomivirkki March 12, 2026 09:03
@web-padawan web-padawan merged commit b4dfade into main Mar 12, 2026
10 checks passed
@web-padawan web-padawan deleted the fix/menu-bar-preserve-active branch March 12, 2026 09:03
vaadin-bot pushed a commit that referenced this pull request Mar 12, 2026
…en (#11331)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
web-padawan added a commit that referenced this pull request Mar 12, 2026
…en (#11331) (#11337)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@vaadin-bot
Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.1.0-beta3.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[menu-bar] active style not applied on menu-bar-button when opened with keyboard

3 participants