Skip to content

[button-group] Toolbar keyboard navigation + new button-group-dropdown component #349

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 21 commits into from
May 6, 2017
Merged

[button-group] Toolbar keyboard navigation + new button-group-dropdown component #349

merged 21 commits into from
May 6, 2017

Conversation

tmorehouse
Copy link
Member

@tmorehouse tmorehouse commented May 6, 2017

Addes ARIA and optional keyboard navigation support to toolbar variant. By default keyboard navigation is disabled, and must be explicitly enabled by setting prop toolbarKeyNav to true (only applicable to toolbar variant), See caveat.

Tabbing into toolbar will focus the first non-disabled visible item. pressing LEFT or UP will focus previous non-disabled item in toolbar. pressing RIGHT or DOWN will focus next non-disabled item in toolbar. SHIFT+LEFT/UP will focus the first non-disabled item in the toolbar, while SHIFT+RIGHT/DOWN will focus the last.

Also introduces new component b-button-group-dropdown for button group dropdowns (split button not supported)

Caveat: Toolbars with text or text-like inputs (via nested input-groups) introduce some issues with Keyboard navigation. When a text (or text-like) input is focused, pressing LEFT/UP/RIGHT/DOWN will not move the text cursor, but instead will jump to previous or next item in the toolbar, making editing text slightly more difficult. This is why keyboard navigation is disabled by default. When enabling keyboard navigation, one should avoid using text or text-like inputs in toolbars.

Addresses 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
Adds optional keyboard navigation to toolbar variant via the prop toolbarKeyNav (Defaults to false).

Keyboard navigation caveat: It is not recommended to place text (or text-like) inputs in a toolbar that has keyboard navigation enabled, as they LEFT/RIGHT/UP/DOWN keys will cause a text input to not cursor through the input, but rather jump to the next or previous control in the toolbar.
Dropdowns for button-groups (split not supported)
Added keyboard support for opening dropdown when button focused.

Clicking button or pressing ENTER or SPACE will open dropdown menu
@tmorehouse tmorehouse requested a review from pi0 May 6, 2017 04:36
@pi0
Copy link
Member

pi0 commented May 6, 2017

Thats so nice @tmorehouse 💯

@pi0 pi0 merged commit 27b9ec1 into bootstrap-vue:master May 6, 2017
@tmorehouse tmorehouse deleted the tmorehouse-toolbar 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