Skip to content

Commit

Permalink
fix: destructure animation event handler
Browse files Browse the repository at this point in the history
  • Loading branch information
emyarod committed Jan 6, 2020
1 parent e3937c0 commit 8692aa9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/react/src/components/Copy/Copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default function Copy({
className,
feedback,
feedbackTimeout,
onAnimationEnd,
onClick,
...other
}) {
Expand All @@ -44,8 +45,8 @@ export default function Copy({
if (event.animationName === 'hide-feedback') {
setAnimation('');
}
if (other.handleAnimationEnd) {
other.handleAnimationEnd(event);
if (onAnimationEnd) {
onAnimationEnd(event);
}
};

Expand Down
5 changes: 3 additions & 2 deletions packages/react/src/components/CopyButton/CopyButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default function CopyButton({
className,
feedback,
feedbackTimeout,
onAnimationEnd,
onClick,
...other
}) {
Expand All @@ -45,8 +46,8 @@ export default function CopyButton({
if (event.animationName === 'hide-feedback') {
setAnimation('');
}
if (other.handleAnimationEnd) {
other.handleAnimationEnd(event);
if (onAnimationEnd) {
onAnimationEnd(event);
}
};

Expand Down

0 comments on commit 8692aa9

Please sign in to comment.