-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
scope: tree viewChanges related to the tree view. This includes TreeView, TreeItem.Changes related to the tree view. This includes TreeView, TreeItem.type: bugIt doesn't behave as expected.It doesn't behave as expected.
Description
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Call focus() on a tree item it does not affect the isTabbable of the newly focused tree item or any of the others.
Expected Behavior 🤔
The newly focused tree item has tabindex 0 and the previously focused has tabIndex -1
Steps to Reproduce 🕹
https://codesandbox.io/s/elastic-snow-ut9t7
Steps:
- Programmatically focus by pressing the 'Programmatic focus' button
- Shift Tab - tree item one has focus when it should be the button
The tabbable variable prevents the expected behaviour.
const handleFocus = event => {
if (!focused && tabbable) {
focus(nodeId);
}
if (onFocus) {
onFocus(event);
}
};
Is this some hacky way to circumvent React ?
Metadata
Metadata
Assignees
Labels
scope: tree viewChanges related to the tree view. This includes TreeView, TreeItem.Changes related to the tree view. This includes TreeView, TreeItem.type: bugIt doesn't behave as expected.It doesn't behave as expected.