Skip to content

Conversation

@web-padawan
Copy link
Member

@web-padawan web-padawan commented Oct 20, 2025

Description

Fixes #10355

Currently, vaadin-menu-bar checks for the first element with tabindex="0" in _setFocused() method. This doesn't work in cases when the button with this attribute gets hidden, especially an overflow button. Updated logic to always set tabindex attribute on the overflow button at the same time as hidden so they always stay in sync.

In addition to the problem reported in the above issue, I also added a test for another similar case originating from the same root issue: pressing Shift + Tab caused two tab stops rather than one (unexpected if tabNavigation isn't set).

menu-bar-shift-tab.mp4

Type of change

  • Bugfix

@web-padawan web-padawan force-pushed the fix/menu-bar-tabindex-recalculate branch from 94c5263 to 332aff8 Compare October 21, 2025 08:23
@web-padawan web-padawan changed the title fix: ensure menu-bar buttons have correct tabindex on resize fix: ensure overflow button always has correct tabindex Oct 21, 2025
@web-padawan web-padawan force-pushed the fix/menu-bar-tabindex-recalculate branch from 332aff8 to 8e45b82 Compare October 21, 2025 08:25
@web-padawan web-padawan force-pushed the fix/menu-bar-tabindex-recalculate branch from 8e45b82 to 1b02619 Compare October 21, 2025 08:35
@web-padawan web-padawan force-pushed the fix/menu-bar-tabindex-recalculate branch 2 times, most recently from b2316f9 to 07e8a24 Compare October 22, 2025 07:09
@web-padawan web-padawan force-pushed the fix/menu-bar-tabindex-recalculate branch from 07e8a24 to a3e6a7e Compare October 22, 2025 08:19
@sonarqubecloud
Copy link

@web-padawan web-padawan removed the request for review from sissbruecker October 22, 2025 09:58
@web-padawan web-padawan changed the title fix: ensure overflow button always has correct tabindex fix: ensure menu-bar buttons always have correct tabindex Oct 22, 2025
@web-padawan web-padawan merged commit 686150f into main Oct 22, 2025
9 checks passed
@web-padawan web-padawan deleted the fix/menu-bar-tabindex-recalculate branch October 22, 2025 09:59
@vaadin-bot
Copy link
Collaborator

Hi @web-padawan and @web-padawan, when i performed cherry-pick to this commit to 24.8, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 686150f
error: could not apply 686150f... fix: ensure menu-bar buttons always have correct tabindex (#10356)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

web-padawan added a commit that referenced this pull request Oct 22, 2025
…10362)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
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] cannot re-focus menu-bar when only overflow button is visible

4 participants