-
Notifications
You must be signed in to change notification settings - Fork 87
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
Unstyled components flashing in Safari #226
Comments
I can see you are calling Suspect there are calls to A small reproducible example would be needed if issue persists 🌹 |
What do you think about using a microtask scheduler instead of RAF for |
It turns in a time war. Who wins will still be determined by how other libraries / user code etc behaves. |
My understanding is that microtasks block the current paint (and as such are guaranteed to execute before the paint). This would guarantee that the styles are added to the DOM and incorporated into the CSSOM before the paint occurs, which would guarantee the styles introduced by a Your point about other libraries or user code is interesting, but after mulling over it for a while I can't think of how they could interfere with this, as they can't unschedule microtasks. In my mind the trade-offs to choose between are:
For me option 1 seems a little better than 2. It still gives the user the opportunity to schedule via RAF if they wish (by calling |
Probably an easy fix in user code as Quick notes:
|
Fair enough, thanks for the quick reply. For now user code sounds like the way to go. If other people start hitting this problem (unlikely at this point) we can revisit baking something into the library. Regarding |
No. Just writes the styles to the tag without any smarts : typestyle/src/internal/typestyle.ts Line 136 in 204b423
|
Description of problem
When using Safari, unstyled components will flash for a split second before becoming styled. This applies to the whole page on initial load as well as components that are rendered when they're opened (like dropdowns and modal dialogs).
Versions
Video
App index
The text was updated successfully, but these errors were encountered: