-
Notifications
You must be signed in to change notification settings - Fork 72
[terra-folder-tree] Added tabIndex for only last focused item #1967
Conversation
Terra.validates.screenshot('tabbed out of focus', { selector: '#root' }); | ||
|
||
browser.keys(['Shift', 'Tab']); | ||
Terra.validates.screenshot('level two folder focused keyboard', { selector: '#expand-collapse-folder-tree' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that we're avoiding adding extra screenshots here, just wondering if there are any potential issues with validating the same screenshot twice in this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done this in the past before, and both screenshots should result in the same identical image, so I believe it should be alright
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need to validate teh same screenshot twice? If we're only checking for focus, we can use the isFocused()
validator since that's more efficient than doing a screenshot comparison.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's right! I keep forgetting we have that, I'll update it to use that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, +1!
Summary
What was changed:
All folder tree children no longer has a tabIndex of 0. When moving through the elements with the arrow keys, the currently focused item is the only item with a tabIndex of 0.
Why it was changed:
Tabbing in and out of the component will not make the user tab through all the items to get to the intended item.
Testing
This change was tested using:
Reviews
In addition to engineering reviews, this PR needs:
Additional Details
This PR resolves:
UXPLATFORM-10109
Thank you for contributing to Terra.
@cerner/terra