wobsoriano/svelte-sonner

Adding multiple toasts in the same event loop breaks layout

enyo opened this issue · 6 comments

enyo commented

If you run this code:

toast('hello')
toast('hello')
toast('hello')

then the layout will be messed up when hovering:

image

Creating them in a different event loop works:

toast('hello')
await new Promise((resolve) => resolve(null))
toast('hello')
await new Promise((resolve) => resolve(null))
toast('hello')

Thanks for reporting! Can you try v0.3.1 and check if the issue is present there as well?

v0.3.2 introduces the ability to set position when creating a toast, and that update might be causing this issue.

enyo commented

Downgrading to v0.3.1 did not solve it.

enyo commented

You can see the behavior here: https://stackblitz.com/edit/vitejs-vite-dnbnjo?file=src%2FApp.svelte (with a pinned v0.3.1 version)

happened with me too on 0.3.3

facing the same problem on v0.3.6

my example - Svelte REPL

Any help would be much appreciated 😃