Skip to content

Commit

Permalink
Add 20% margin to the animation timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Sep 18, 2024
1 parent 3686a86 commit d774215
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/components/src/modal/use-modal-exit-animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ export function useModalExitAnimation() {
new Promise< void >( ( timeoutResolve ) => {
setTimeout(
() => timeoutResolve(),
FRAME_ANIMATION_DURATION_NUMBER + 1
// Allow an extra 20% of the animation duration for the
// animationend event to fire, in case the animation frame is
// slightly delayes by some other events in the event loop.
FRAME_ANIMATION_DURATION_NUMBER * 1.2
);
} );

Expand Down

0 comments on commit d774215

Please sign in to comment.