Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Aug 21, 2024
1 parent 79237a5 commit 949ca4f
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ export function useCollapsibleContent(
const originalAnimationName =
element.style.animationName === 'none' ? '' : element.style.animationName;
const originalTransitionDuration = originalTransitionDurationStyleRef.current;
// cancel animation/transitions for these specific instances:
// 1. when initially open, on mount/load, it should just appear fully open but remain animated per styles afterwards
// 2. when using `hidden='until-found'` and is opened by find-in-page, it should open instantly but remain animated // as styled afterwards
const shouldCancelAnimation = isBeforeMatch || isInitiallyOpen;

element.style.animationName = 'none';
Expand Down

0 comments on commit 949ca4f

Please sign in to comment.