flowbite-svelte
flowbite-svelte copied to clipboard
Toast close events don't propagate
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
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.
Same here, toast has no events... on:close doesnt exist? If it is dismissable how do you know if it has closed?
Please try:
<Toast on:close={() => toastStatus = false}>
Close me!
</Toast>
I did do that, the on:close event is not fired and my ide is acting as if it does not exist
Ran into the same issue. I submitted a PR for a potential fix. Hats off to the maintainers and contributors of this library! It's a joy to use. https://github.com/themesberg/flowbite-svelte/pull/1383
https://github.com/themesberg/flowbite-svelte/pull/1383 merged. Thank you.