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
Jetpack Compose version: 1.7.6
Jetpack Compose component(s) used:
animation
When you use
sharedElementWithCallerManagedVisibility
, the shared element is always drawn in the overlay. This means it won't respect things likezIndex
and will always be clipped by the overlay clip.This is because
SharedElementInternalState.shouldRenderInOverlay
always returnstrue
because it usessharedElement.foundMatch
which doesn't take the element visibility or the transition running into effect so as long as there are two matching elements in the composition, it will be rendered in the overlay.You can work around this by not adding
sharedElementWithCallerManagedVisibility
if it isn't visible.Here is an example. The expected is to see a large gray box with a small black circle on top. But what's actually shown is small gray box (overlay clip) and no black box (z-index not being respected).