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

[@astrojs/svelte] passing class to island component behaves differently from passing to static component #5029

Closed
1 task
JannikWempe opened this issue Oct 9, 2022 · 1 comment · Fixed by #5045
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@JannikWempe
Copy link

JannikWempe commented Oct 9, 2022

What version of astro are you using?

1.4.6

Are you using an SSR adapter? If so, which one?

Vercel

What package manager are you using?

pnpm

What operating system are you using?

Mac

Describe the Bug

Passing a class prop from the outside into a Svelte component behaves differently if you assign client:something or not.

If I assign client:load the class prop is erased from the component. I just see a small blink where the class is applied before it's been erased.

How am I supposed to apply classes from a parent like that? Am I missing something?

Sidenote: I have encountered it applying margin via Tailwind classes but it is applicable to classes in general.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-x1aahc?file=src/pages/index.astro

It works in Preact: https://stackblitz.com/edit/github-yudtcj?file=src/components/Counter.tsx

Participation

  • I am willing to submit a pull request for this issue.
@matthewp matthewp added the - P4: important Violate documented behavior or significantly impacts performance (priority) label Oct 10, 2022
@matthewp
Copy link
Contributor

Looks like this was added here: https://github.com/withastro/astro/pull/1406/files#diff-0bac01b129c0097c2262479a0cf79644ef556ba4cc69f0e8ef5874de2a06c2be. Not sure why. Seems wrong. Think we can remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants