[WV2] Fix Safari-specific bug for play/pause button state
This commit is contained in:
parent
97a035b3a3
commit
ff3dd2249e
1 changed files with 3 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
class OutfitViewer extends HTMLElement {
|
||||
#internals;
|
||||
#isPlaying = true; // Track playing state internally (Safari CustomStateSet bug workaround)
|
||||
#hasAnimations = false; // Track hasAnimations state internally (Safari CustomStateSet bug workaround)
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
|
@ -64,12 +65,12 @@ class OutfitViewer extends HTMLElement {
|
|||
this.querySelector("outfit-layer:state(has-animations)") !== null;
|
||||
|
||||
// Check if state actually changed
|
||||
const hadAnimations = this.#internals.states.has("has-animations");
|
||||
if (hasAnimations === hadAnimations) {
|
||||
if (hasAnimations === this.#hasAnimations) {
|
||||
return; // No change, skip
|
||||
}
|
||||
|
||||
// Update internal state
|
||||
this.#hasAnimations = hasAnimations;
|
||||
if (hasAnimations) {
|
||||
this.#internals.states.add("has-animations");
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue