Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in @astrojs/svelte integration when using slots inside if/else statement #5690

Closed
1 task done
MoustaphaDev opened this issue Dec 28, 2022 · 0 comments · Fixed by #6250
Closed
1 task done

Bug in @astrojs/svelte integration when using slots inside if/else statement #5690

MoustaphaDev opened this issue Dec 28, 2022 · 0 comments · Fixed by #6250
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: svelte Related to Svelte (scope)

Comments

@MoustaphaDev
Copy link
Member

MoustaphaDev commented Dec 28, 2022

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

  • I am willing to submit a pull request for this issue.
@MoustaphaDev MoustaphaDev added pkg: svelte Related to Svelte (scope) - P3: minor bug An edge case that only affects very specific usage (priority) labels Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: svelte Related to Svelte (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants