Reopening a popup during its fade out kept the previous contents

72ee2b0863
This commit is contained in:
the-djmaze 2026-11-02 17:49:39 +01:00
parent 45b4df3912
commit 2ecd6b0745

View file

@ -94,7 +94,13 @@ const
i18nToNodes(vmDom);
visiblePopups.add(vm);
vmDom.style.zIndex = 3001 + (visiblePopups.size * 2);
vmDom.showModal();
// The dialog is only closed on transitionend, so reopening
// during the fade out finds it still open, and showModal on
// an open dialog throws. That threw out of this subscriber
// and out of modalVisible(true), so showScreenPopup never
// reached vm.onShow and the popup kept the previous item's
// values until it was closed and opened again.
vmDom.open || vmDom.showModal();
if (vmDom.backdrop) {
vmDom.backdrop.style.zIndex = 3000 + (visiblePopups.size * 2);
}