fix(shared-transitions): layer opacity set back to original on next tick (#10310)

This commit is contained in:
Nathan Walker
2023-06-12 20:44:15 -07:00
committed by GitHub
parent 622f3659d8
commit 0956cb0f91

View File

@ -286,7 +286,10 @@ export function snapshotView(view: UIView, scale: number): UIImage {
view.layer.renderInContext(UIGraphicsGetCurrentContext());
const image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
view.layer.opacity = originalOpacity;
setTimeout(() => {
// ensure set back properly on next tick
view.layer.opacity = originalOpacity;
});
return image;
}