Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding multiple toasts in the same event loop breaks layout #24

Closed
enyo opened this issue Nov 13, 2023 · 7 comments · Fixed by #28
Closed

Adding multiple toasts in the same event loop breaks layout #24

enyo opened this issue Nov 13, 2023 · 7 comments · Fixed by #28
Labels
help wanted Extra attention is needed

Comments

@enyo
Copy link
Contributor

enyo commented Nov 13, 2023

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')
@wobsoriano
Copy link
Owner

wobsoriano commented Nov 13, 2023

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
Copy link
Contributor Author

enyo commented Nov 14, 2023

Downgrading to v0.3.1 did not solve it.

@enyo
Copy link
Contributor Author

enyo commented Nov 14, 2023

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

@AyushSehrawat
Copy link

happened with me too on 0.3.3

@shimulroy842
Copy link

shimulroy842 commented Dec 9, 2023

facing the same problem on v0.3.6

my example - Svelte REPL

@wobsoriano wobsoriano added the help wanted Extra attention is needed label Dec 28, 2023
@wobsoriano
Copy link
Owner

Any help would be much appreciated 😃

@jals1212
Copy link

jals1212 commented Jul 22, 2024

This "solves" the problem (1.1.3)

 setTimeout(() => {
            toast('hello')
            }, 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants