-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
fix(snack-bar): add content fade in animation #7504
Conversation
Adds a subtle fade in animation to the snack bar content. Fixes angular#7502.
@@ -23,7 +24,15 @@ import {MAT_SNACK_BAR_DATA} from './snack-bar-config'; | |||
encapsulation: ViewEncapsulation.None, | |||
preserveWhitespaces: false, | |||
changeDetection: ChangeDetectionStrategy.OnPush, | |||
animations: [ | |||
trigger('contentFade', [ | |||
state('void', style({opacity: '0'})), |
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.
I think you can just use :enter
instead of having to manage states.
trigger('contentFade', [ | ||
state('void', style({opacity: '0'})), | ||
state('visible', style({opacity: '1'})), | ||
transition('void => visible', animate('350ms linear')) |
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.
Should we use the animations from core?
`${AnimationCurves.STANDARD_CURVE} ${AnimationDurations.ENTERING}`
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.
Does that work now with AOT? I thought string interpolation in animation broke it.
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.
That comment is pretty old. It seems to work with AoT now.
Addressed the feedback @josephperrott, PTAL. One note: I'm not too sure about using the |
Yeah, what we likely would like to do is delay the start of the animation by ~100ms so that it times better, but I think that increasing the overall length will work just as well. |
@crisbeto Linter? |
Fixed. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds a subtle fade in animation to the snack bar content.
Fixes #7502.