From 2a247dd70b57ab322cb2d5b38a37e2f88e0867dc Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 25 Mar 2026 13:16:50 +0800 Subject: [PATCH] fix(toast): remove shake class before hiding to ensure animationend fires When dismiss() was called on a persistent+shaking toast, the .shake CSS rule (declared after .hiding) overrode toast-out animation. If shake had already finished, no animationend fired and the element was never removed. Co-Authored-By: Claude Sonnet 4.6 --- web/js/api.js | 1 + 1 file changed, 1 insertion(+) diff --git a/web/js/api.js b/web/js/api.js index 8d1c7bf..a946588 100644 --- a/web/js/api.js +++ b/web/js/api.js @@ -42,6 +42,7 @@ export function showToast(title, { message, level = "error", duration = 4000, sh const dismiss = () => { if (!el.parentNode) return; + el.classList.remove("shake"); el.classList.add("hiding"); el.addEventListener("animationend", () => el.remove(), { once: true }); };