Skip to content

Shared Element Transition broken with safe area #7111

@mrousavy

Description

@mrousavy

🐛 Bug Report

The Shared Element Transition seems to not animate to the correct bounds.

Here's a video of the SET breaking on a phone that has left and right "edges"

20210507-154223-720x1480.mp4

In this case I think the problem is that the screen absolute coordinates are used, which are not equal to the coordinates relative to the React Root view and they extend beyond those screen "edges":

(just assuming things here)

Here's another case of the bounds animation failing, this is a regular phone without any "safe areas", just the 24px statusbar:

recorded-3550743286521.MP4

Here the image seems to be a bit higher up than it should be, looks to me as if it were exactly twice the statusbar moved up. Maybe there's a - STATUS_BAR_HEIGHT somewhere where it should be a + STATUS_BAR_HEIGHT instead, just assuming things again. You can also see that after I fast-refresh the view, it goes into the correct place, so it has to be an issue with the RNN SET.

Maybe statusBar: { drawBehind: true } or statusBar: { visible: false } is not respected here?

Have you read the Contributing Guidelines on issues?

yea

To Reproduce

  1. Create Shared Element Transition
  2. Try it on phones with Safe Areas, or in my case just a regular Huawai P10

Expected behavior

It should exactly animate to the bounds of the target react view

Actual Behavior

it animates to some wrong coordinates.

Your Environment

  • React Native Navigation version: 6f7c2d9
  • React Native version: 0.64.1
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): all

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions