-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(#2449): ActionBar: Restore focus to SelectableCollection on Esc #2451
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
Conversation
52c2a07 to
a4f462f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…rlay Esc key handler Per: #2451 (comment)
This comment was marked as outdated.
This comment was marked as outdated.
3f6ffab to
a1accf0
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
ktabors
left a comment
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.
Can we run chromatic on this change?
I also experimented with selecting a couple rows, moving focus to a cell in an unselected row, going into the ActionBar, pressing escape twice and the focus goes to the cell where the last row selection happened, not where focus was within the table.
This comment was marked as outdated.
This comment was marked as outdated.
|
@ktabors I think the behavior you're seeing makes sense, if you leave a collection that has selections, even if you looked at a few more items, when you come back, you'll be at either the first or last selected item (depending if you arrived via Tab vs shift+Tab). So even though you cleared the selection with Esc, I think returning to where you had a selection makes sense |
This comment was marked as outdated.
This comment was marked as outdated.
By using `useLayoutEffect` instead of `useEffect`, we seem to be able to eliminate need to wait two `requestAnimationFrame` calls before trying to restore focus to the `restoreFocusRef.current`.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
Closes #2449
✅ Pull Request Checklist:
📝 Test Instructions:
It may be useful testing the following behavior using a tool such as NerdeFocus to log items as they receive focus.
🧢 Your Project:
Adobe/Accessibility