-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Conversation
With little changes like this one we can do good things 👍 |
Would love to see this merged. I'm a blind web developer refactoring to Angular directives, and was disappointed to discover that tabs weren't keyboard accessible. Tabbing between them didn't work, nor did selecting them with enter. That said, I wasn't sure what the best keyboard access model might be. Typical tab-and-enter is the most obvious choice, but there are sometimes instances where I'd want a more traditional menu/tab flow (I.e. tab to a horizontal menu that gets treated as a single tab stop, then left/right arrow through horizontal items, selecting with enter.) I'm not familiar enough with directives to know if, say, I could override key handling on an individual instance, but there's definitely not a one-size-fits-all for keyboard access. My hope is that directives are flexible enough to account for that. |
@ndarilek thnx for looking into this. We are determined to make those directives accessible so an remarks from a person using a screen reader on a daily basis would be highly appreciated. If you've got any suggestions regarding tabs or any other directive, please share. |
Cool. I'm new to Angular and directives, so realize this question is For instance, my current Angular app just uses standard Bootstrap tabs to tab through tab links for free. However, if I wanted to implement a navigation style where the tab key only landed on the menu, and the user needed to use right and left arrows to cycle through menu items (I.e. similar to standard system menus or tab bars), I need only set tabindex=0 on the root nav, -1 on each link, and a custom key handler. I'd also set ARIA roles on the nav and each link to mark them as a menu and menu items, respectively. These wouldn't necessarily be good changes to roll into the default |
@ndarilek We try to encapsulate the Bootstrap's HTML complexity, into one custom element. So, by just adding these attributes on the The good news though, is that every template is very easy to override and apply any custom behavior and attributes you want without any special effort. If you want to build the project locally, you can try and feedback for the rating and the progressbar directives that have already been made accessible. Anyway, it would be awesome if you could help with this effort in this and the other directives :-) |
Hmm, I'd have to think through this a bit more. As I see it, there are
I'm not sure which should be used in this instance. It's tough being |
While trying to implement the keyboard navigation I faced a problem with the tabs array in the controller. The But, because linking function for the static tabs fire before the dynamic (ie ng-repeat) ones, the order we have is sometimes falsy. For example, for the tab's demo: <tabset>
<tab heading="Static title">Static content</tab>
<tab ng-repeat="tab in tabs" heading="{{tab.title}}" ></tab>
<tab heading="Alert title"></tab>
</tabset> the actual order for the tabs in controller is: There is a workaround, like having a "global" variable inside the @angular-ui/bootstrap I wonder, if I miss something obvious or this is an issue I should raise in the AngularJS. |
@bekos , there's a similar issue with slides in the carousel. The tabs array also needs to update what the tabs are re-ordered, and ngRepeat re-orders them. Off the top of my head, the easiest way I can think of is to watch the |
@chrisirhc Thx for the info. Do you think it's worth raising this issue at Angular? |
@bekos, just thought of another thing, it might be interesting to see if the scope's child scope order reflects the order of the DOM. I think one of the early principles of Angular (I could be wrong, or this might've changed) is that the scope reflects what's in the DOM. That might be a way to raise the issue at Angular, to see if there are any plans to make the expose child element/directives order perhaps through the scope. And yes, I think it's worth raising it, just not sure how to put it across. Perhaps directives need to be aware of child element directives' order? Something like the jqLite's find but just for "finding" directives. |
Closing in favor of #4772. |
TODO: add keyboard navigation