Badge dismiss event not triggering #1039
-
From flowbite-svelte documentation: A dismiss event will be dispatched during the dismissal, listen to it if needed. <script> import { Badge } from 'flowbite-svelte'; function handleClose(event) { alert('Badge dismissed'); } </script>Default I used the exact same code in my sveltekit project and the dismiss event does not trigger. The alert is never fired. Tried putting a console.log() in there. The function is clearly not being triggered. They also have the option of addding your custom close button. From documentation: Use the close-button slot to add your desired button. Don’t forget to use the slot prop close to dismiss your badge. <script> import { Badge } from 'flowbite-svelte'; import { CloseCircleSolid } from 'flowbite-svelte-icons'; </script> Default Remove badgeBut when i try this approach it throws up an error: that it could not find the slot "close-button". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Solved by upgrading to latest version of flowbite-svelte. My earlier upgrade command: npm upgrade flowbite-svelte returned success but didn't update. What worked was: npm install flowbite-svelte@latest |
Beta Was this translation helpful? Give feedback.
Solved by upgrading to latest version of flowbite-svelte. My earlier upgrade command:
npm upgrade flowbite-svelte returned success but didn't update.
What worked was:
npm install flowbite-svelte@latest