fix: #8686 prevent useGridCell from overriding child focus restoration loops#10228
fix: #8686 prevent useGridCell from overriding child focus restoration loops#10228jsmitrah wants to merge 4 commits into
Conversation
snowystinger
left a comment
There was a problem hiding this comment.
Thanks for the interest, if you run yarn format it should get rid of all the noisy whitespace changes that I'm guessing your IDE applied
0a7cf3b to
714723c
Compare
|
Thanks @snowystinger, all tests are passed |
ccb8bbd to
4b28c4a
Compare
71950d3 to
22b6e5f
Compare
| return; | ||
| } | ||
|
|
||
| // If the cell itself is focused, wait a frame so that focus finishes propagatating |
There was a problem hiding this comment.
This seems like an important comment. JSDOM and the act environment is not a reliable test against this as it's simulating real browsers.
Did you run this against real browsers? If I recall, document.activeElement can be updated at different times depending on the browser you're in as well.
There was a problem hiding this comment.
Good catch, @snowystinger. To avoid the timing issues of the document.activeElement across different real browsers, I updated the approach to use e.relatedTarget.
By checking e.relatedTarget synchronously, we can instantly determine if focus is moving directly into a nested child element. This provides identical, reliable accuracy in both JSDOM and real browsers without needing to wait for a frame
I've pushed the update.
b06221e to
adbba17
Compare
6ab9b4c to
bce1556
Compare
Closes #8686
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: