-
Notifications
You must be signed in to change notification settings - Fork 980
[Toast] Manually reverse tab order #1469
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
1aef6fb
to
4dd564b
Compare
3384853
to
907477d
Compare
Looks like there's a regression in the toast order between foreground/background caught by Chromatic. |
That’s expected right? we are choosing not to reorder which is why this is a breaking change. |
haha of course! 🤦♂️ I thought somehow |
Not in the DOM sense no, they dictate the nature of the announcement. I assume that chromatic story is intended to validate DOM order though so perhaps it could be updated to make that clearer. |
Yeah I think that's what confused me. |
f617db2
to
0540626
Compare
* Manually reverse tab order * Feedback * Versions * Fix rebase clobber * Typo
fixes #1322
builds on #1468
As described in #1322 – We use portals to move
Toasts
into theViewport
, out of the box this causes issues with keyboard accessibility as the append only nature of portals means our source order places most recent toasts last. We were previously using mutation observer to re-order the DOM and solve for it, unfortunately this causes issues with animation libraries which depend on a stable DOM order.After much investigation there appears to be no fool proof way to re-order DOM without causing issues downstream. Instead this change manages focus programatically so that the tab order reflects newest -> oldest toast without touching the DOM structure.