xiaoluoboding / vue-sonner

🔔 An opinionated toast component for Vue.
https://vue-sonner.vercel.app
MIT License
803 stars 41 forks source link

Issue when creating multiple toasts in a loop #73

Open vikramsoni2 opened 2 months ago

vikramsoni2 commented 2 months ago

try to run 3 toasts in a loop.

it just shows one toast and the other toasts are in html but behind the first toast, and it does not expand on hover. the first toast just moves a little bit when hovered.

that-ambuj commented 2 months ago

I also have the same issue.

ronaldemo commented 1 week ago

Use setTimeout to add interval between them. e.g.

const sleep = ms => new Promise(r => setTimeout(r, ms))
const addToasts = async (items) => {
  for (const item of items) {
    addToast(item)
    await sleep(1)
  }
}