Skip to content
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

fix keyboarding behavior for right and left arrow keys in Tree View #5899

Merged
merged 5 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change files
  • Loading branch information
chrisdholt committed Apr 27, 2022
commit f169acedf3c2a03cf25d52747b18ca7e36abc82c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix keyboarding behavior for right and left arrow keys in Tree View",
"packageName": "@microsoft/fast-foundation",
"email": "chhol@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class TreeView extends FoundationElement {
case keyArrowLeft:
if (e.target && this.isFocusableElement(e.target as HTMLElement)) {
const item = e.target as HTMLElement;
// when focus is on an open node, close the node

if (
item instanceof TreeItem &&
item.childItemLength() > 0 &&
Expand All @@ -160,8 +160,6 @@ export class TreeView extends FoundationElement {
) {
TreeItem.focusItem(item.parentElement);
}
// when focus is on a child node that is also either an end node or a closed node,
// move focus to its parent
}
return false;
case keyArrowRight:
Expand Down