kbrgl / svelte-french-toast

🍞🥂 Buttery smooth toast notifications for Svelte
https://svelte-french-toast.vercel.app/
MIT License
809 stars 28 forks source link

Laggy scroll issue on chrome mobile #30

Open pierregoutheraud opened 1 year ago

pierregoutheraud commented 1 year ago

When using this library on android chrome mobile, the root wrapper <div class="toaster" /> is making any scroll anywhere on the website laggy: it feels like an fps drop, scroll is not as smooth and it is quite noticeable once you spotted it. I am not sure why this happens and it might be a chrome mobile issue related to the wrapper being a position fixed div but it could be something else.

I made a quick hack fix by not displaying the container while it does not have any children. This should of course be done properly directly in the lib, but here is the fix FYI:

:global(.toaster) {
  display: none;
}
:global(.toaster:has(div)) {
  display: block;
}
kbrgl commented 1 year ago

Thanks for reporting! Would you be willing to share a video?