Skip to content

chore: Fix one of two animation issues #3510

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

Draft
wants to merge 52 commits into
base: feat/expandable-drawer
Choose a base branch
from

Conversation

at-susie
Copy link
Member

@at-susie at-susie commented May 15, 2025

Description

This PR fixes an animation issue for global-drawer.
We would like to have a smooth transition when a drawer is being closed.

Before this change, the style drawer-hidden was added immediately when a close button is clicked, which was one of the two reasons for the unwanted sudden closing behavior. To address this, I added additional condition like below to make sure only after the Transition's component state becomes exited.:
[styles['drawer-hidden']]: !show && state === 'exited',
And I updated relevant styles accordingly.

Secondly, the .global-tools selector in the skeleton was set to inline-size: 0px when panels are closed without any transition, which was another reason for the unwanted behavior.

Issue-2.mp4

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

at-susie added 30 commits May 3, 2025 07:26
@at-susie at-susie requested review from gethinwebster and georgylobko and removed request for a team and gethinwebster May 15, 2025 13:11
An error occurred while trying to automatically change base from feat/expandable-drawer to main May 21, 2025 07:55
@@ -75,7 +75,7 @@ function AppLayoutGlobalDrawerImplementation({
(isExpandedPrevious && !isExpanded);

return (
<Transition nodeRef={drawerRef} in={show || isExpanded} appear={show || isExpanded} timeout={0}>
<Transition nodeRef={drawerRef} in={show || isExpanded} appear={show || isExpanded} timeout={60}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do this using unmountOnExit?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unmountOnExit doesn't seem to help. As long as we keep timeout={0}, the Transition component instantly becomes exited state where we cannot have smooth exiting motion.

display: block;
border-inline-start: none;
> .global-drawer-wrapper {
opacity: 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to do is to unmount the drawer after exiting the animation. How these styles help us achieving this?

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

Successfully merging this pull request may close these issues.

2 participants