Skip to content

Styles get delayed #15773

@hahahatey

Description

@hahahatey

Describe the bug

Hello everyone
I came across strange behavior. I have a subtree that rendered conditionally. If some element has bind:clientWidth in the subtree then styles get delayed.
How it can be seen.
We can set transition property for opacity in conditional rendered component, set initial opacity as 0 and see when its mounted transition happens from 1 to 0.
It happens only for the first mount for next ones everything works fine.

Its worth to mention that svelte is located in shadowDom

Reproduction

https://stackblitz.com/edit/vitejs-vite-vzuce61q?file=src%2FExample.svelte

Logs

System Info

Chrome Version 135.0.7049.42 
Apple M3 Pro Sequoia 15.4
"svelte": "^5.23.1",

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions