fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Inline drawer animation causes content to jump

Open ling1726 opened this issue 3 years ago • 5 comments

Feel free to close if this is by design.

While the animation of the drawer slide is smooth, it will push the content immediately, making it jump horizontally and leaving and empty space while the drawer slides in.

jumpy drawer

ling1726 avatar Sep 21 '23 09:09 ling1726

This is by design, but I'll leave this open as we will revisit this with the designers. The reason we have this animation now is the performance.

marcosmoura avatar Sep 21 '23 09:09 marcosmoura

This is by design, but I'll leave this open as we will revisit this with the designers. The reason we have this animation now is the performance.

Does this explain why the custom animation doesn't seem to have this issue?

spmonahan avatar Sep 21 '23 21:09 spmonahan

This is by design, but I'll leave this open as we will revisit this with the designers. The reason we have this animation now is the performance.

Does this explain why the custom animation doesn't seem to have this issue?

Inline animations are terrible for performance. They usually rely on width, height, margin, or padding, which cannot be processed by the compositor. Because as they push the sibling nodes, a full reflow and repaint cycle happens as well. Also, a standalone inline Drawer has no knowledge of the "main" content of the page, so we must use techniques to guess what content would be placed next to a Drawer.

Overlay drawers don't suffer from this issue as they use transform, which create a 3d layer and are much more optimized.

The "custom animation" example mimics an implementation on the App side, which is fully aware of the Drawer as a sidebar and the main content and can synchronize the animations. They implement the same behavior seen on overlay Drawers, using transform and opacity together to create a more optimized animation (60fps+).

marcosmoura avatar Sep 25 '23 15:09 marcosmoura

I'm hoping to look into developing a fix, do you have any suggestions on where to start? I can see about implementing transform into the component animations. If you cant think of anything I can figure it out.

dgray0229 avatar Sep 26 '23 03:09 dgray0229

For now, we'll keep the animations as is. The design team will review the need to change this in the future. As we support custom animations, it is fairly easy to override the default one.

marcosmoura avatar Oct 26 '23 15:10 marcosmoura