-
Notifications
You must be signed in to change notification settings - Fork 534
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
[TreeView] Check if the active element is a treeitem #4484
Conversation
🦋 Changeset detectedLatest commit: b3c1107 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
Hi! Sorry, I don't understand the before video and how this change would fix it. Can you please describe what's happening in the video and what should happen after. Thanks! |
@siddharthkp I updated the PR description. Let me know if it needs anymore clarification |
Thank you adding more context ❤️ Can you also please add a story and test in primer/react so that we don't create a regression in the future, thank you! I'm happy to work on this together if you'd like |
@@ -891,6 +898,57 @@ export const InitialFocus: Story = () => ( | |||
</div> | |||
) | |||
|
|||
export const FocusManagement: Story = () => ( |
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.
@siddharthkp added a story and test in 4df63b8
Screen.Recording.2024-04-19.at.12.24.32.PM.mov
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.
Thank you! ❤️
|
When navigating through the TreeView, the focus should be on the list item. However, when a user clicks on a secondary action inside the list, the user is no longer able to focus back on the list item when navigating to the list. This PR is to fix the focus in TreeView when active element is not a treeitem
Before
Screen.Recording.2024-04-09.at.5.50.02.PM.mov
After
Untitled.mov
Changelog
New
Changed
Ensures the
document.activeElement
is ofrole=treeitem
before returning focus to the TreeView listitemRemoved
Rollout strategy
Testing & Reviewing
Merge checklist