themesberg / flowbite-svelte

Official Svelte components built for Flowbite and Tailwind CSS
https://flowbite-svelte.com
MIT License
1.97k stars 233 forks source link

Toast close events don't propagate #1348

Open selfagency opened 1 month ago

selfagency commented 1 month ago

Describe the bug

The on:close event on the Toast component does not bubble up and therefore cannot trigger a secondary function (like removing the toast data from my state manager).

It works on version 0.44.24. But 45 and up, it's broken.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-zmyrcp?file=src%2Froutes%2F%2Bpage.svelte

Make sure the package.json says 0.46.1 and that it wasn't rewritten cuz I had a weird problem where it reset to 0.44.24 on its own.

Flowbite version and System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/kit: ^2.5.4 => 2.5.4 
    flowbite-svelte: ^0.46.1 => 0.46.1 
    svelte: ^4.2.12 => 4.2.12 
    vite: ^5.1.6 => 5.1.6
Daschi1 commented 3 weeks ago

Yes, I am experiencing the same issue. Additionally, the open property is no longer exported from the Toast component, which prevents binding to it using bind:open. Upon reviewing the source code, it appears that TransitionFrame.svelte is masking it.