-
Notifications
You must be signed in to change notification settings - Fork 601
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 toolbar focus bug #6836
Fix toolbar focus bug #6836
Conversation
Could I get a second review on this PR? @EisenbergEffect @chrisdholt @nicholasrice |
Yep, I've got it pulled down to smoke and validate. Thanks |
@chrisdholt, were you able to perform the validation you wanted on this branch? |
change/@microsoft-fast-foundation-903a969b-3de3-4090-974a-3423344c571c.json
Outdated
Show resolved
Hide resolved
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.
Updated dependentChangeType
- will get this in. Thanks for the contribution!
* Fix focus issue when clicking on an element in the toolbar * remove describe.only * Change files * Update api-report.md * Update change/@microsoft-fast-foundation-903a969b-3de3-4090-974a-3423344c571c.json --------- Co-authored-by: Chris Holt <[email protected]>
* Fix bug in toolbar click handler when a slotted element has child elements (#6830) * Fix bug with nested elements in toolbar click handler * Change files * lint * update change description * slight test improvement * Update change/@microsoft-fast-foundation-2ada25c3-3fb4-48ba-893d-e64d11f7f095.json --------- Co-authored-by: Chris Holt <[email protected]> * Fix toolbar focus bug (#6836) * Fix focus issue when clicking on an element in the toolbar * remove describe.only * Change files * Update api-report.md * Update change/@microsoft-fast-foundation-903a969b-3de3-4090-974a-3423344c571c.json --------- Co-authored-by: Chris Holt <[email protected]> * update change files * revert unintended change --------- Co-authored-by: Chris Holt <[email protected]>
* Fix focus issue when clicking on an element in the toolbar * remove describe.only * Change files * Update api-report.md * Update change/@microsoft-fast-foundation-903a969b-3de3-4090-974a-3423344c571c.json --------- Co-authored-by: Chris Holt <[email protected]>
Pull Request
📖 Description
Resolves #6835
There is a bug where when clicking on an element in the toolbar focuses the
activeIndex
element before focusing the clicked element. This can lead to visual oddities. This PR is intended to resolve that bug.🎫 Issues
#6835
👩💻 Reviewer Notes
I changed the toolbar to use the
mousedown
event rather than theclick
event to update the toolbar'sactiveIndex
because themousedown
event is fired beforefocusin
, thus resolving the timing issue wherefocusin
focused the previously focused element prior toclick
focusing the newly focused element.📑 Test Plan
I wasn't able to write a test that failed prior to my change but passes with it because the issue was a temporary state that was passed through during a
click
operations. However, I wrote two new tests that exercise the modified code path.I also manually tested my change in Chrome, Edge, and Firefox.
✅ Checklist
General
$ yarn change
Component-specific
⏭ Next Steps
N/A