microsoft / fast

The adaptive interface system for modern web experiences.
https://www.fast.design
Other
9.25k stars 590 forks source link

Fix toolbar focus bug #6836

Closed mollykreis closed 11 months ago

mollykreis commented 1 year ago

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 the click event to update the toolbar's activeIndex because the mousedown event is fired before focusin, thus resolving the timing issue where focusin focused the previously focused element prior to click 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

Component-specific

⏭ Next Steps

N/A

mollykreis commented 11 months ago

Could I get a second review on this PR? @EisenbergEffect @chrisdholt @nicholasrice

chrisdholt commented 11 months ago

Could I get a second review on this PR? @EisenbergEffect @chrisdholt @nicholasrice

Yep, I've got it pulled down to smoke and validate. Thanks

mollykreis commented 11 months ago

@chrisdholt, were you able to perform the validation you wanted on this branch?