sidenav CSS should use will-change: transform
Bug, feature request, or proposal:
Sidenav should use will-change: transform in order to remove jank where possible
What is the expected behavior?
sidenavs should have their own rendering layer
What are the steps to reproduce?
just use a sidenav and look at its CSS properties
What is the use-case or motivation for changing an existing behavior?
sidenavs can be laggy on their first animation
Which versions of Angular, Material, OS, browsers are affected?
all
There are a lot of tips about the use of will-change. See here
will-change should be only applied if the page is not performing well and shouldn't be used on many elements.
Since we aren't able to figure out if your page is performing well, I would say that developers should apply the will-change on their own.
Also the md-sidenav should already have its own layer, since it's using transform3d
There definitely are some occasional frame drops when opening a sidenav, but I'm not sure that it's because of the transform.
Yep, I got frame drops too, even with a hello world. Maybe it would go away if I used AOT, although Chrome is supposed to drive animations on a separate process I believe... I had noticed the translateZ(0px), but it's kind of a hack. It's not as explicit as will-change: transform.
I know you're not supposed put tons of separate rendering layers in a page, but we can be almost sure that 99.99% of the time, there will be at most 2 sidenavs. That's just two layers. It's not like if it were 50... No ?
@iuliust That's true. I will take a look at the performance of the sidenav and keep you updated.
If this is something that the user should apply themselves, it should be part of the overview doc.
Yeah good idea. We still need to evaluate whether the will-change should be applied by default or not. Thoughts on this @jelbourn?
I'm not sure that the transform is to blame here. It might be better to spend some time investigating it instead.
For sure, transform3d should already elevate the md-sidenav into its own rendering layer.
The jank was caused by continually setting the width on every change detection, it should be fixed now.
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.