diff --git a/.changeset/twelve-needles-bathe.md b/.changeset/twelve-needles-bathe.md new file mode 100644 index 0000000000..f294343cd6 --- /dev/null +++ b/.changeset/twelve-needles-bathe.md @@ -0,0 +1,5 @@ +--- +"@heroui/toast": patch +--- + +show animation when closing all modals (#5620) diff --git a/packages/components/toast/src/toast-provider.tsx b/packages/components/toast/src/toast-provider.tsx index d203129a08..4370c7fff0 100644 --- a/packages/components/toast/src/toast-provider.tsx +++ b/packages/components/toast/src/toast-provider.tsx @@ -82,7 +82,9 @@ export const closeAll = () => { const keys = globalToastQueue.visibleToasts.map((toast) => toast.key); - keys.map((key) => { - globalToastQueue?.close(key); + keys.forEach((key, index) => { + setTimeout(() => { + globalToastQueue?.close(key); + }, index * 100); }); };