Unexpected behaviour when using an Icon within ClientOnly fallback
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 96
- Avg merge
- 8h 12m
- Merged PRs (30d)
- 2
Description
Consider following code for your app:
<style>
.loading {
font-size: 2rem;
}
</style>
<template>
<ClientOnly>
<template #fallback>
<div class="loading">
<Icon name="svg-spinners:ring-resize" />
Loading
</div>
</template>
<div class="content" ref="someRef">
This text should NOT be large!
Remove the <pre>ref="someRef"</pre> from the parent and it works
</div>
</ClientOnly>
</template>
Expected behaviour when loading the page:
A big loading spinner, and, when everything is done loading, some normal text, like this:
Instead, you get this:
When you remove the ref="someRef" from the content div, it works as expected
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided Vue reproduction using ClientOnly, its #fallback slot, Icon, and the content div with ref="someRef". Compare loading and completed rendering with and without the ref, then trace the relevant Icon and ClientOnly behavior. Done means the fallback shows a large spinner while the completed content keeps normal text sizing when the ref is present.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100