Skip to content

[EuiFlyout] Animate push flyouts #7205

Closed

Description

@ThomThomson

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.

Activity

  1. cee-chen commented on Sep 20, 2023

    @cee-chen
    Contributor

    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 😅

  2. added
    design decision
    on Sep 20, 2023
  3. ThomThomson commented on Sep 20, 2023

    @ThomThomson
    ContributorAuthor

    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

  4. changed the title [-]Animate push flyouts[/-] [+][EuiFlyout] Animate push flyouts[/+] on Sep 30, 2023
  5. self-assigned this
    on Sep 30, 2023
  6. cee-chen commented on Sep 30, 2023

    @cee-chen
    Contributor

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

  7. ThomThomson commented on Oct 3, 2023

    @ThomThomson
    ContributorAuthor

    @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

Metadata

Metadata

Assignees

Labels

design decision

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions