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

svelte:element buggy behaviour with class:foo #7521

Closed
AlbertMarashi opened this issue May 9, 2022 · 6 comments · Fixed by #7531
Closed

svelte:element buggy behaviour with class:foo #7521

AlbertMarashi opened this issue May 9, 2022 · 6 comments · Fixed by #7531

Comments

@AlbertMarashi
Copy link

AlbertMarashi commented May 9, 2022

Describe the bug

Svelte is having buggy behavior with the new svelte:element. The advanced classes (class:foo) do not properly work with props for some reason. I haven't narrowed down why, but I have created a REPL below.

Reproduction

https://svelte.dev/repl/c74f48f8e55445c9b02734145bf78391?version=3.48.0

Workarounds

not using class:foo, and switching to class="{foo ? 'foo' : ''}" (at the cost of missing unused classes)

System Info

N/A

Severity

annoyance

@baseballyama
Copy link
Member

This is compiler bug and this is because of this PR.
#7486

Already I fixed it up in my local but I would like to check for a similar issue is there or not.

@AlbertMarashi
Copy link
Author

#7478 Duplicate issue and solved by #7486

@baseballyama
Copy link
Member

baseballyama commented May 9, 2022

Oh Please reopen this.🙏

I mean #7486 introduced this bug and I will create new PR.

@Conduitry Conduitry reopened this May 10, 2022
@AlbertMarashi
Copy link
Author

Oh Please reopen this.🙏

I mean #7486 introduced this bug and I will create new PR.

My bad sorry

@bfanger
Copy link
Contributor

bfanger commented May 12, 2022

Reproduction of this bug in the context of a SvelteKit app: https://stackblitz.com/edit/sveltekit-ef9nqu?file=src/routes/[bug].svelte

@doceazedo
Copy link

If this is of any use, this bug also happens when the slot of the component is updated. The class disappears, although the value is correct: https://svelte.dev/repl/88605f45add6421da45265233c235edf?version=3.48.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants