Skip to content

Commit

Permalink
front: update event listener to use parent element for animation end
Browse files Browse the repository at this point in the history
Signed-off-by: nncluzu <[email protected]>
  • Loading branch information
kmer2016 committed Jan 7, 2025
1 parent 18e4c0d commit ae78c18
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ const StdcmVias = ({ disabled = false }: StdcmConfigCardProps) => {

const cancelListener = () => cancelAnimationFrame(requestId);

newElement.addEventListener('animationend', cancelListener);
newElement.parentElement!.addEventListener('animationend', cancelListener);
return () => {
newElement.removeEventListener('animationend', cancelListener);
cancelListener();
newElement.parentElement!.removeEventListener('animationend', cancelListener);
};
}, [newIntermediateOpIndex]);

Expand Down

0 comments on commit ae78c18

Please sign in to comment.