Skip to content

[tabs] Add in ARIA and keyboard navigation support #339

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

Merged
merged 22 commits into from
May 5, 2017
Merged

[tabs] Add in ARIA and keyboard navigation support #339

merged 22 commits into from
May 5, 2017

Conversation

tmorehouse
Copy link
Member

@tmorehouse tmorehouse commented May 4, 2017

Better ARIA referencing and roles for generated elements.

To enable full ARIA compliance, each b-tab must have a document unique id assigned to them. If ids are not supplied then only the roles and aria-states are assigned (partial ARIA compliance). If an optional document unique ID is assigned to prop buttonId on b-tab, it will be used as the tab controller's id, otherwise one is generated based on the supplied b-tab id prop (or none if no id). These ids are required to let screen readers know which tab controller is controlling which tab-pane.

This PR also allows keyboard navigation LEFT/UP to move to previous non-disabled tab, and RIGHT/DOWN to get to next non-disabled tab. using key modifier SHIFT with LEFT/UP or RIGHT/DOWN will move to the first or last (respectively) non-disabled tab.

As a side effect, this fixes a bug when programmatically calling vm.prev() or vm.next() which, previously, wouldn't let you skip past disabled tabs.

Address parts of #333

* Create form-input-static.vue

New form-static input

* Added form-input-static compoinent

* Refactored static input

Refactored to use the new `<b-form-input-static>` component

* Switch to bFormInputStatic

Updated child component var to bFormInputStatic to follow proper naming conventions

* Removed lazyFormatter from static-input

* Added trailing semi-colon

To make CircleCI happy

* Added missing 'this'

* [nav-item] add dropdown class

* Added <slot> for robustness

* new b-form-input-static component (#292)

* Create form-input-static.vue

New form-static input

* Added form-input-static compoinent

* Refactored static input

Refactored to use the new `<b-form-input-static>` component

* Switch to bFormInputStatic

Updated child component var to bFormInputStatic to follow proper naming conventions

* Removed lazyFormatter from static-input

* Added trailing semi-colon

To make CircleCI happy

* Added missing 'this'

* Added <slot> for robustness

* fixed missing `.vue` extension on import

* Added missing extension on component import (#293)

* Optimized import order in form-input.vue (#294)

* Added missing extension on component import

* Optimized import order
Add ARIA IDs to the tab buttons if the tab has an id
If tab has an ID then generate a `controlledBy` id for ARIA accessibility
Prop buttonId allows user to specify the ID they would like on the tab controllers generated for the tab-panes.
Allows next() and prev() methods to skip over disabled tabs, by introducing a 3rd argument to setTab(index, force, offset).
This allows the direction of travel to be passed as -1, 0, or +1 in the offset argument.

Also fixes a bug where programmatically calling next() or prev() would stop if the next or previous tab was disabled
Some screen readers prefer the aria-expanded over aria-hidden (and vice versa).
@tmorehouse tmorehouse requested a review from pi0 May 4, 2017 22:56
Allows using SHIFT+LEFT/UP to go to first non-disabled tab
Allows using SHIFT+RIGHT/DOWN to go to last non-disabled tab
@tmorehouse tmorehouse changed the title [tabs] Add in ARIA and keyboard nvigation support [tabs] Add in ARIA and keyboard navigation support May 5, 2017
@pi0
Copy link
Member

pi0 commented May 5, 2017

I did merge blind without local tests :)
@mosinve Your idea on this would be so much useful.

@pi0 pi0 merged commit ef1f65c into bootstrap-vue:master May 5, 2017
@tmorehouse tmorehouse deleted the tmorehouse-tabs-navs-aria branch May 6, 2017 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants