twbs / bootstrap

The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
https://getbootstrap.com
MIT License
167.89k stars 78.51k forks source link

Horizontal tabs: Down and Up Arrows usage not allowed #39969

Open vaiFaW opened 1 month ago

vaiFaW commented 1 month ago

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

marwenbenhajhassine commented 1 month ago

A potential fix could involve dynamically adjusting the keydown event handlers based on the aria-orientation attribute of the tab component