-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Components: Allow limiting the number of maximum visible Snackbars #58559
Conversation
Size Change: +46 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
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.
Great crease to iron out @Mamaduka 🥳
I like it, but not that the 3+ snackbars show up after dismissing a more recent one. I would expect that the old snackers are actually gone when they're "gone". |
I checked other libraries like Sonner, and they have the same behavior. The prop controls how many Snackbars are visible simultaneously; it's not actually removing the snackbars from the store. |
Is there a reason the consumer can't modify the notice array themselves before it hits |
I don't have a strong opinion here, happy to move logic into consumers. I will create a follow-up tomorrow morning. |
Here's the follow-up. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core SVNIf you're a Core Committer, use this list when committing to
GitHub Merge commitsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
Resolves #53201.
PR updates the
SnackbarList
component to allow limiting the number of maximum visible Snackbars.Why?
Reduces noise in the editors.
How?
Introduces new
maxVisible
property and sets it to3
for post and site editors.Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2024-02-01.at.17.23.30.mp4