-
Notifications
You must be signed in to change notification settings - Fork 38
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
[MS] Fixes animation for toast progress bar #6165
Conversation
Maybe use a ref instead of IDs? (you can look at how we modify css values in the sidebarMenu component for an example) |
c264c17
to
e8ca124
Compare
So... `#${toastId} {
&.active {
&::part(container) {
&::after {
width: 0%;
transition: width ${duration}s ease-in-out;
}
}
}
}`; this does get applied to the toast but for some reason the transition doesn't work. If you remove the |
e8ca124
to
daa2442
Compare
Instead of all the black magic, I've instead added a I've also fixed a bug where the animation of a toast would play at its creation instead of when it's shown. |
daa2442
to
352c16e
Compare
@@ -85,7 +85,9 @@ ion-toast.notification-toast { | |||
&::part(container) { | |||
&::after { | |||
width: 0%; | |||
transition: width 5s ease-in-out; | |||
transition-duration: var(--ms-toast-duration); |
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.
You can keep the condensed property:
transition: width var(--ms-toast-duration) ease-in-out;
352c16e
to
3a93660
Compare
3a93660
to
f1b09c9
Compare
Closes #6163
It would probably be easier if toast where our own component, we could probably just bind the duration with Vue. Sadly, they're created by the toastController.
The idea behind this fix is to assigned a unique id to each toast, and dynamically add a
<style>
tag in the<head>
of the page that contains the CSS with the appropriate duration. The style is removed once the toast is closed.