Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Attachment actions
Unintended behavior
View staffing
Description
Component used: Animation Version used: 1.0.0
My use case:
I'm writing a composable for video playback. The player itself is expensive and loads async. While it's loading, it doesn't render anything, so I want to show a thumbnail preview over it. When the video loads, I'd like for the thumbnail to fade out. However, when the video player becomes inactive/unfocused, I want the thumbnail to appear instantly rather than fade back in.
Here's a rough structure of how I'd like to set this up:
I like how my desired behavior is expressed in this part:
However, I can't actually use this, because despite using
snap()
, there's what seems to be a one-frame delay when changingshowThumbnail
fromfalse
totrue
. For a split second, I can see the underlying (blank) video composable behind the thumbnail.I can work around this by short-circuiting the
showThumbnail
condition:This works, but it's uglier in my opinion. I'd love to be able to write it the first way.
Sample project attached.