$focus.next()
fails to focus the next tabbable element
#4228
Unanswered
beautifulmim
asked this question in
5. Bugs
Replies: 2 comments
-
I've found the same issue as this with hidden elements blocking this when using arrows |
Beta Was this translation helpful? Give feedback.
0 replies
-
I've come across this too. I believe it's due to how tabbable is configured within the focus plugin. I've opened a discussion to see if we can make this configurable so it will properly check for hidden elements. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've encountered a potential bug where the focus plugin fails to progress to the next focusable item when there's a hidden element in between (sort of an invisible wall. I assume it may happen for any of the conditions tabbable defines an element not tabbable). You can easily reproduce this by adding a "display: none" style to the "Second" button on the following page: https://alpinejs.dev/plugins/focus
In the wrap example is more noticeable since you can go from First to Third (pressing left cursor) button but you can't go through the Second button.
I conducted a test and
$focus.getNext()
is returning elements not meant to be tabbable. I think this might be related.I encountered this behavior while implementing a custom select component with a filter input.
Beta Was this translation helpful? Give feedback.
All reactions