Skip to content
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

[EuiFlyout] Animate push flyouts #7205

Closed
ThomThomson opened this issue Sep 20, 2023 · 4 comments · Fixed by #7239
Closed

[EuiFlyout] Animate push flyouts #7205

ThomThomson opened this issue Sep 20, 2023 · 4 comments · Fixed by #7239

Comments

@ThomThomson
Copy link
Contributor

Enhancement

Would it be possible to animate push flyouts like the overlay flyouts are animated?

Overlay

Sep-20-2023 10-52-53

Push

Push

Complication

It seems like the intention behind disabling animations on the push flyout was to avoid forcing width transitions on the rest of the page content. To get the best of both worlds, it might be possible to animate a child element instead of the parent element of the push flyout, so that the width change happens instantly, but the content of the flyout appears to animate in.

@cee-chen
Copy link
Contributor

cee-chen commented Sep 20, 2023

As you mentioned in your last paragraph, performance is the largest reason to avoid this. Animating width causes simultaneous reflow and repaint events which is the worst possible performance for animations (and will only scale worse for complex pages w/ lots of resize observers, etc).

As you also mentioned, doing a single width change with a transform is likely the easiest way to performantly add some sort of animation (https://developer.chrome.com/blog/performant-expand-and-collapse/), but I kinda question how "good" that will look (since the rest of the page will jump instantly while the content doesn't). Here's an example codesandbox of an accordion using that technique: https://codesandbox.io/s/983z7n92rw

I'll try to take some time later this week to spike out how a push flyout would look with that same type of animation, but we should definitely run this by a designer for final approval 😅

@ThomThomson
Copy link
Contributor Author

ThomThomson commented Sep 20, 2023

For reference here's our use case:

On Dashboards, width changes are not animated but the transforms of the panels are, so when you open a push flyout you get a nice (slightly debounced so it only happens once) slide animation.

With the push flyout not animating at all, it can look slightly jarring.

Reflow

@cee-chen cee-chen changed the title Animate push flyouts [EuiFlyout] Animate push flyouts Sep 30, 2023
@cee-chen cee-chen self-assigned this Sep 30, 2023
@cee-chen
Copy link
Contributor

cee-chen commented Sep 30, 2023

@ThomThomson #7239 has a staging preview of push flyouts with a toggleable animation - is it looking good to you so far?

@ThomThomson
Copy link
Contributor Author

@cee-chen that's amazing! It's exactly what I was picturing. I think it should work really well with the Dashboard's squashing animation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants