Skip to content

Commit 788f766

Browse files
committed
Fix animation cancellation in token-transitions
1 parent 496d34c commit 788f766

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/codehike/src/utils/token-transitions.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ function toSnapshotElement(el: HTMLElement): SnapshotElement {
241241
y += p.offsetTop
242242
p = p.offsetParent
243243
}
244+
el?.getAnimations().forEach((a) => a.cancel())
244245
const style = window.getComputedStyle(el)
245246
const color = style.color
246247
const content = el.textContent

0 commit comments

Comments
 (0)