You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(Presence): handle escape characters in animation names correctly
Fixesradix-ui#2763.
Using [CSS.escape](https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape_static_method).
As I checked, this API is supported in all browsers even in the
[2022 browserslist targets](radix-ui#1019 (comment))
of this project.
Further explanation of the bug:
`getComputedStyle()` returns a `CSSStyleDeclaration`, which is
serialized according to the spec.
Meanwhile, the values from `AnimationEvent` are not required to be
serialized (which makes sense, as it's intended for JavaScript usage,
where escaping for CSS syntax is unnecessary). Therefore the
`animationName` is returned as-is in the event handler, causing the
mismatch.
0 commit comments