From ff3dd2249ee0cb0a98762dd4bb765563d76fbaea Mon Sep 17 00:00:00 2001 From: Emi Matchu Date: Thu, 5 Feb 2026 19:03:17 -0800 Subject: [PATCH] [WV2] Fix Safari-specific bug for play/pause button state --- app/assets/javascripts/outfit-viewer.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/outfit-viewer.js b/app/assets/javascripts/outfit-viewer.js index 5187ffb3..243bff5c 100644 --- a/app/assets/javascripts/outfit-viewer.js +++ b/app/assets/javascripts/outfit-viewer.js @@ -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 {