This repository was archived by the owner on Mar 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
feat(Tree): left and right arrow keyboard navigation #1451
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ae9db9a
removed circular navigation property
silviuaavram 3f0684a
implemented left-right kb navigation
silviuaavram d0f5cba
added tests to behaviors
silviuaavram b14600b
Merge branch 'master' into feat-tree-navigation-left-right
silviuaavram d1df8c2
fixed a bug caused by merge
silviuaavram 5ea2690
Merge branch 'master' into feat-tree-navigation-left-right
silviuaavram a4ce9d6
changelog
silviuaavram db99a93
used refs directly in TreeItem
silviuaavram 4efebd7
removed unneeded parameter
silviuaavram 7caeb9a
refactored the open logic
silviuaavram d8e4d27
Merge branch 'master' into feat-tree-navigation-left-right
silviuaavram abbe377
Merge branch 'feat-tree-navigation-left-right' of https://github.com/…
silviuaavram 8fe9c72
added unit tests
silviuaavram 6d4524b
Merge branch 'master' into feat-tree-navigation-left-right
silviuaavram 8bcfd47
implemented code review
silviuaavram 9062b90
Merge branch 'feat-tree-navigation-left-right' of https://github.com/…
silviuaavram 58eea3f
updated behavior in doc
silviuaavram 0d0f630
fixed a destructuring issue
silviuaavram 4da3d84
renamed the handlers
silviuaavram 15a1a9d
Merge branch 'master' into feat-tree-navigation-left-right
silviuaavram 02f47b0
Merge branch 'master' into feat-tree-navigation-left-right
silviuaavram 9995d30
merged master
silviuaavram cdfaaf3
improved tests
silviuaavram dfb2624
Merge branch 'master' into feat-tree-navigation-left-right
silviuaavram 7b54477
Merge branch 'master' into feat-tree-navigation-left-right
silviuaavram 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
25 changes: 25 additions & 0 deletions
25
packages/react/src/lib/accessibility/Behaviors/Tree/treeItemBehavior.ts
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Accessibility } from '../../types' | ||
import * as keyboardKey from 'keyboard-key' | ||
|
||
/** | ||
* @specification | ||
* Triggers 'getFocusFromParent' action with 'ArrowLeft' on 'root'. | ||
* Triggers 'setFocusToFirstChild' action with 'ArrowRight' on 'root'. | ||
*/ | ||
const treeItemBehavior: Accessibility = (props: any) => ({ | ||
attributes: { | ||
root: {}, | ||
}, | ||
keyActions: { | ||
root: { | ||
getFocusFromParent: { | ||
keyCombinations: [{ keyCode: keyboardKey.ArrowLeft }], | ||
}, | ||
setFocusToFirstChild: { | ||
keyCombinations: [{ keyCode: keyboardKey.ArrowRight }], | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
export default treeItemBehavior |
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
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.