[WV2] Fix bug with play/pause visibility

This commit is contained in:
Emi Matchu 2026-02-06 17:50:32 -08:00
parent b462272dc3
commit 6f7b307e39

View file

@ -396,6 +396,13 @@ class OutfitViewerPlayPauseToggle extends HTMLElement {
"outfit-layer:state(has-animations)", "outfit-layer:state(has-animations)",
) !== null, ) !== null,
); );
// After a Turbo morph, Idiomorph may remove our `hidden` attribute
// (since the server HTML never includes it). Re-apply visibility
// based on the current animation state.
document.addEventListener("turbo:render", () => {
this.#syncFromOutfitViewer();
});
} }
#syncFromOutfitViewer() { #syncFromOutfitViewer() {