-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Remove toasts from DOM after hiding them #27807
Comments
Shouldn't we change the selector by something like that: Because if folks wants to keep using the same toast, they have to add new toast to their DOM everytime 😟 /CC @XhmikosR |
Also fine by me, but I would prefer the same approach for alerts and toasts unless there's a reason why we use different approaches. |
I don't know why we choose to remove the alert from the DOM, but I'm not a big fan of removing things from the DOM... |
Well, the idea is that if we are going to reuse an element, we should just hide it, otherwise remove it. On the other hand, hiding/showing should be faster than adding/removing... |
A toast should be reusable, so I think the CSS solution suits better here |
From #27792 (comment):
We also do this with the alerts. The problem with not removing them is that there's a margin above the second toast if we dismiss the first: https://deploy-preview-27792--twbs-bootstrap4.netlify.com/docs/4.1/components/toasts/#stacking
The text was updated successfully, but these errors were encountered: