-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Toolbar KBN Improvements: Add Info to A11y Docs #9139
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
Open
arman-boyakhchyan
wants to merge
4
commits into
DevExpress:feature/26_2_toolbar-kbn-improvement
Choose a base branch
from
arman-boyakhchyan:toolbar-kbn-improvements-a11y-docs-updates-26-2
base: feature/26_2_toolbar-kbn-improvement
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 89 additions & 8 deletions
97
concepts/05 UI Components/Toolbar/05 Accessibility/15 Keyboard Navigation.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,24 +1,105 @@ | ||
| A user can use the following keys to interact with the Toolbar component when [allowKeyboardNavigation](/api-reference/10%20UI%20Components/dxToolbar/1%20Configuration/allowKeyboardNavigation.md '/Documentation/ApiReference/UI_Components/dxToolbar/Configuration/#allowKeyboardNavigation') is set to `true`: | ||
| You can use the following keys to interact with the Toolbar component when [allowKeyboardNavigation](/api-reference/10%20UI%20Components/dxToolbar/1%20Configuration/allowKeyboardNavigation.md '/Documentation/ApiReference/UI_Components/dxToolbar/Configuration/#allowKeyboardNavigation') is set to `true`: | ||
|
|
||
| <table class="dx-table"> | ||
|
dmlvr marked this conversation as resolved.
|
||
| <tr> | ||
|
dmlvr marked this conversation as resolved.
|
||
| <th>Key</th> | ||
| <th>Action</th> | ||
| </tr> | ||
| <tr> | ||
| <td>Tab</td> | ||
| <td>If a Toolbar receives focus, it focuses its first available item.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>Shift + Tab</td> | ||
| <td>If a Toolbar receives focus, it focuses its last available item.</td> | ||
| <td>Tab / Shift + Tab</td> | ||
| <td>Moves focus to and away from the Toolbar. The first time users focus the Toolbar after initialization, the component highlights the first item. Subsequent focus events restore the previously highlighted item.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>Left Arrow / Right Arrow</td> | ||
| <td>Moves focus to the previous or next available Toolbar item.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>Up Arrow / Down Arrow</td> | ||
| <td>In the overflow, moves focus menu to the previous or next available Toolbar item.<br>When a ButtonGroup item has focus in the toolbar, moves focus between the ButtonGroup items.</td> | ||
| </tr> | ||
| <tr> | ||
| <td>Home / End</td> | ||
| <td>Moves focus to the first or last available Toolbar item.</td> | ||
| </tr> | ||
| </table> | ||
| <tr> | ||
| <td>Enter / Space</td> | ||
| <td>Activates the focused Toolbar item.</td> | ||
| </tr> | ||
| </table> | ||
|
|
||
| This keyboard navigation behavior applies to standalone Toolbar instances, as well as instances embedded in DevExtreme components such as DataGrid, FileManager, and Gantt. You can modify this behavior to allow users to navigate between items using **Tab**. Disable [allowKeyboardNavigation](/Documentation/ApiReference/UI_Components/dxToolbar/Configuration/#allowKeyboardNavigation) in a [defaultOptions()](/Documentation/ApiReference/UI_Components/dxToolbar/Methods/#defaultOptionsrule) call as follows: | ||
|
|
||
| --- | ||
|
|
||
| ##### jQuery | ||
|
|
||
| <!-- tab: index.js --> | ||
| DevExpress.ui.dxToolbar.defaultOptions({ | ||
| options: { | ||
| onInitialized(e) { | ||
| if ($(e.element).closest('.dx-component-name').length) { | ||
| e.component.option('allowKeyboardNavigation', false); | ||
| } | ||
| } | ||
| } | ||
| }) | ||
|
|
||
| ##### Angular | ||
|
|
||
| <!-- tab: app.component.ts --> | ||
| import dxToolbar from "devextreme/ui/toolbar"; | ||
| import { type DxToolbarTypes } from "devextreme-angular/ui/toolbar"; | ||
| // ... | ||
| export class AppComponent { | ||
| constructor() { | ||
| dxToolbar.defaultOptions({ | ||
| options: { | ||
| onInitialized(e: DxToolbarTypes.InitializedEvent) { | ||
| if (e.element?.closest('.dx-component-name')) { | ||
| e.component?.option('allowKeyboardNavigation', false); | ||
| } | ||
| } | ||
| } | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| ##### Vue | ||
|
|
||
| <!-- tab: App.vue --> | ||
| <script setup lang="ts"> | ||
| import dxToolbar from "devextreme/ui/toolbar"; | ||
| import { type DxToolbarTypes } from "devextreme-vue/toolbar"; | ||
|
|
||
| dxToolbar.defaultOptions({ | ||
| options: { | ||
| onInitialized(e: DxToolbarTypes.InitializedEvent) { | ||
| if (e.element?.closest('.dx-component-name')) { | ||
| e.component?.option('allowKeyboardNavigation', false); | ||
| } | ||
| } | ||
| } | ||
| }); | ||
| </script> | ||
|
|
||
| ##### React | ||
|
|
||
| <!-- tab: App.tsx --> | ||
| import dxToolbar from "devextreme/ui/toolbar"; | ||
| import { type ToolbarTypes } from "devextreme-react/toolbar"; | ||
|
|
||
| dxToolbar.defaultOptions({ | ||
| options: { | ||
| onInitialized(e: ToolbarTypes.InitializedEvent) { | ||
| if (e.element?.closest('.dx-component-name')) { | ||
| e.component?.option('allowKeyboardNavigation', false); | ||
| } | ||
| } | ||
| } | ||
| }); | ||
|
|
||
| --- | ||
|
|
||
| Replace `.dx-component-name` with a component ID or class. | ||
|
|
||
| [important] If you disable **allowKeyboardNavigation**, Toolbar no longer follows the [W3C ARIA APG Toolbar Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/). Your application will be less accessible to users who rely on keyboard navigation. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.