Bug in @astrojs/svelte integration when using slots inside if/else statement #5690
Closed
1 task done
Labels
- P3: minor bug
An edge case that only affects very specific usage (priority)
pkg: svelte
Related to Svelte (scope)
What version of
astro
are you using?1.8.0
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Ubuntu 22.04
Describe the Bug
When I use an if/else statement in svelte to conditionally show an open and close menu icon passed through slots, the icons don't disappear after click, but new ones get added. I am using the latest version of Astro and the
@astrojs/svelte
integration.Expected behavior:
After clicking on the icon, the if/else statement should toggle and show the alternate icon.
Actual behavior:
After clicking on the icon, the if/else statement does not toggle and the original icons remains visible, and icons add up after each click.
I think I found an issue for this bug a while ago but I can't find it anymore
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-w44dd3?file=src%2Fcomponents%2FHamberger.svelte,src%2Fcomponents%2FHamberger.astro,src%2Fpages%2Findex.astro&on=stackblitz
Participation
The text was updated successfully, but these errors were encountered: