-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(drawer): drawer container animating when open by default #7129
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(drawer): drawer container animating when open by default #7129
Conversation
.subscribe((event: AnimationEvent) => { | ||
// Set the transition class on the container so that the animations occur. This should not | ||
// be set initially because animations should only be triggered via a change in state. | ||
if (event.toState !== 'open-instant') { |
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.
this._element.nativeElement.classList.toggle('mat-drawer-transition', event.toState != 'open-instant');
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.
The second param isn’t supported on IE.
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.
Ah, in that case can we still at least use classList.add
instead of the Renderer
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.
The renderer is SSR-friendly. AFAIK we can stop using it in Angular 5.
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.
Don't animation events not fire on the server?
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.
AFAIK they could fire if the sidenav starts off opened.
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.
Hmm ok, just needs rebase then
fc16ed9
to
537882b
Compare
@crisbeto Fix linter failure? |
* Prevents the drawer container from animating if it's open on load. * Fixes `_updateStyles` being called twice in a row on init, because the first animations are `void->void` and `void->open-instant`. Fixes angular#7007.
537882b
to
9b8968c
Compare
Ready to go. |
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. |
_updateStyles
being called twice in a row on init, because the first animations arevoid->void
andvoid->open-instant
.Fixes #7007.