Mirror: React hooks for accessible, common web interactions. UI super powers without the UI.

Fix animation cancellation ordering

Changed files
+3 -1
src
+3 -1
src/useStyleTransition.ts
···
: options.easing || 'ease',
};
+
// NOTE: Must be run before cancellation below
+
const keyframes = applyKeyframe(element, options.to || {});
+
const prevAnimation = animations.get(element);
if (prevAnimation) prevAnimation.cancel();
-
const keyframes = applyKeyframe(element, options.to || {});
const animation = element.animate(keyframes, effect);
animation.playbackRate = 1.000001;