-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Horizontal tabs: Down and Up Arrows usage not allowed #39969
Comments
A potential fix could involve dynamically adjusting the keydown event handlers based on the aria-orientation attribute of the tab component |
Thank you for reporting this issue, @vaiFaW The current behavior of Navs and tabs with JavaScript is as follows:
Based on my understanding of the keyboard interaction rules in Tabs Patterns, the only modification we would need to implement is to remove the support for top and down arrows when the tab is horizontal. This would allow the top and down arrows to scroll the page vertically. @patrickhlauke, would this change be acceptable or mandatory? If so, we can proceed to review #40643. |
From the last time I tested it, most screen readers didn't actually announce the orientation of a tablist. So a user lands on a tab inside a tablist, but they're not told whether it's horizontal or vertical. So having the doubled-up key events here was to make sure that regardless of orientation, SR users would be able to easily move between tabs, without having a 50/50 chance of their initial keystrokes just being ignored ("let me go right ... oh, that didn't do anything ... maybe the tab list is vertical, let me try going down"). in short: while it's correct to say that depending on |
note that ARIA APG patterns aren't rules, or a standard. they're suggestions, and a large chunk of the APG patterns are known to be broken, incomplete, or just plain bad. |
The rule for a non-SR keyboard user seemed acceptable and interesting. However, based on the feedback provided by Patrick in #39969 (comment), if there's no way to ensure that all screen readers announce the orientation of a tablist, it seems better to maintain the current behavior. Therefore, I would support keeping the existing functionality. |
Thanks again for reporting this issue. Based on the elements shared by Patrick, unfortunately we won't be able to modify the current behavior to handle this use case, as it would be an issue for some SRs users. We think it's safer this way. |
I appreciate your feedback on my pull request regarding the differentiated keydown responses based on the aria-orientation attribute. I would like to provide additional context and clarification on the practices involved and the benefits of this approach. Users generally expect different keyboard interactions based on the orientation of navigation components. For horizontal tablists, the left and right arrow keys are used to navigate between tabs, while the up and down arrow keys scroll the page. For vertical tablists, the up and down arrow keys navigate between tabs. This differentiation improves the intuitiveness and usability of our navigation system. |
sure, but as i said: even if you do add |
@patrickhlauke Proposed Balanced Solution
|
Prerequisites
Describe the issue
According to the W3C tabs pattern:
When a tab list has its aria-orientation set to vertical:
Down Arrow performs as Right Arrow (moves focus to the next tab).
Up Arrow performs as Left Arrow (moves focus to the previous tab).
If the tab list is horizontal, it does not listen for Down Arrow or Up Arrow so those keys can provide their normal browser scrolling functions even when focus is inside the tab list.
These rules aren't supported by Boostrap 5 actually
Reduced test cases
It's possible to check these keyboard interactions in the documentation page https://getbootstrap.com/docs/5.3/components/navs-tabs/
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Chrome, Firefox, Microsoft Edge
What version of Bootstrap are you using?
v5.3
The text was updated successfully, but these errors were encountered: