Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

web-padawan
Copy link
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

Copy link

sonarcloud bot commented Jul 19, 2024

@vaadin-bot
Copy link
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