Skip to content

fix: make first item focusable when selected is negative - #7574

Merged
web-padawan merged 1 commit into
mainfrom
fix/negative-selected-focus
Jul 19, 2024
Merged

web-padawan merged 1 commit into
mainfrom
fix/negative-selected-focus

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

Fixes #6392

The issue is caused by_getAvailableIndex helper. Due to roving tabindex, it switches to the last item if the idx is less than 0. But in this particular case, it becomes a problem as the last item gets tabindex="0" (instead of the first one).

As we already have a call to _setFocusable() where we check if selected is non-empty, I figured out the easiest fix is to update it to pass 0 also for cases when selected is less than 0. This way the first available item gets tabindex="0".

Type of change

  • Bugfix

@sonarqubecloud

Copy link
Copy Markdown

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha6 and is also targeting the upcoming stable 24.5.0 version.

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.

Tabs with autoselect=false has LAST tab as default tab-stop

3 participants