You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using universal, the sidenav (in side mode) will be rendered already open in the initial page load, and then when the app bootstraps, it will stay open.
What is the current behavior?
The initial pre-rendered page loads with the sidenav closed, and then when the app boostraps, the sidenav animates open.
What is the use-case or motivation for changing an existing behavior?
In beta 8, it worked perfectly. The initial pre-rendered html file aligned with the bootstrap re-render.
Now, the page loads with the sidenav closed, and after a number of seconds later (when the app bootstraps) the sidenav suddenly animates open, which is quite distracting.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Since the margins for the mat-drawer-content depend on elements that haven't been rendered yet, Universal can't possibly predict the width, leaving it static at 0, and populated on bootstrap on the client. The "animation" is really just the transition CSS firing once the width is populated. At least that's my theory, it all depends on how Angular (and Universal) constructs the application in order (since I think Universal just gives it one go)
@mmalerba Is there a possible refactoring we can do here, maybe by searching the element tree for CSS width if none other is available?
There's also currently an issue open angular/angular#19235 that is tracking an issue with style.property not being applied correctly if the property name is in camelCase (in drawer, this is marginRight and marginLeft).
Hi, any updates on this? In my case it was working OK with Angular 5.0.2 and material 5.0.0.rc0 but stop working when updated to Angular 5.2.8 and material 5.2.4
angular-automatic-lock-bot commented on Sep 8, 2019
Activity
CaerusKaru commentedon Sep 30, 2017
The problem here is actually deeper than anticipated. See here:
https://github.com/angular/material2/blob/20a23f16e8ac1ced29172709cc837fa500b6377b/src/lib/sidenav/drawer.ts#L347-L350
https://github.com/angular/material2/blob/20a23f16e8ac1ced29172709cc837fa500b6377b/src/lib/sidenav/drawer.ts#L553-L585
Since the margins for the
mat-drawer-contentdepend on elements that haven't been rendered yet, Universal can't possibly predict the width, leaving it static at 0, and populated on bootstrap on the client. The "animation" is really just the transition CSS firing once the width is populated. At least that's my theory, it all depends on how Angular (and Universal) constructs the application in order (since I think Universal just gives it one go)@mmalerba Is there a possible refactoring we can do here, maybe by searching the element tree for CSS width if none other is available?
CaerusKaru commentedon Oct 15, 2017
As documented in #7795, there's also an issue with
transform: translate3d(0,0,0)not being applied correctly.CaerusKaru commentedon Oct 15, 2017
There's also currently an issue open angular/angular#19235 that is tracking an issue with
style.propertynot being applied correctly if the property name is in camelCase (in drawer, this ismarginRightandmarginLeft).mmalerba commentedon Nov 28, 2017
should be fixed by #8488
CaerusKaru commentedon Dec 5, 2017
@mmalerba Issue not resolved by #8488
fix(drawer): avoid initial animation when rendering on the server
fix(drawer): avoid initial animation when rendering on the server
fix(drawer): avoid initial animation when rendering on the server (#8828
CaerusKaru commentedon Dec 6, 2017
@crisbeto Still not fixed
algcifaldi commentedon Jan 8, 2018
As far as I can tell, this is still happening in the latest release. Is #8969 the new issue to track for status updates?
agustinhaller commentedon Mar 13, 2018
Hi, any updates on this? In my case it was working OK with Angular
5.0.2and material5.0.0.rc0but stop working when updated to Angular5.2.8and material5.2.4angular-automatic-lock-bot commentedon Sep 8, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.