-
Notifications
You must be signed in to change notification settings - Fork 172
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
base: feat/expandable-drawer
Are you sure you want to change the base?
Conversation
…ape-design/components into explore-drawer-animation
…lore-drawer-animation
@@ -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}> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
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 becomesexited
.:[styles['drawer-hidden']]: !show && state === 'exited',
And I updated relevant styles accordingly.
Secondly, the
.global-tools
selector in the skeleton was set toinline-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
CONTRIBUTING.md
.CONTRIBUTING.md
.Security
checkSafeUrl
function.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.