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(component): only focus on TreeItem when focus within Tree component #1087

Merged
merged 3 commits into from
Jan 5, 2023

Conversation

chanceaclark
Copy link
Contributor

@chanceaclark chanceaclark commented Jan 4, 2023

What?

Focuses on the TreeItem whenever the document.activeElement is within the Tree.

Also, updates Tree tests to reflect better testing patterns (see #635).

Why?

This fixes the behavior we've seen for a while which causes the tree to be initially focused on initial render. This causes some accessibility concerns as the we place the user onto the tree instead of the initial page or, in the case of modals, launch order.

Screenshots/Screen Recordings

Before After
Screen.Recording.2023-01-04.at.12.39.44.mov
Screen.Recording.2023-01-04.at.11.56.55.mov

Testing/Proof

Added two additional tests, along with updating the Tree tests to reflect better testing patterns.


Closes #801

@chanceaclark chanceaclark marked this pull request as ready for review January 4, 2023 20:33
@chanceaclark chanceaclark requested review from a team as code owners January 4, 2023 20:33
Copy link
Contributor

@jorgemoya jorgemoya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

Copy link
Contributor

@MariaJose MariaJose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼 !

@chanceaclark chanceaclark merged commit 64d102d into bigcommerce:master Jan 5, 2023
@chanceaclark chanceaclark deleted the fix/tree-focus branch January 5, 2023 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants