Skip to content
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

Shared Element Transitions: Animating to transformed view doesn't work correctly #6729

Closed
mrousavy opened this issue Oct 30, 2020 · 1 comment

Comments

@mrousavy
Copy link
Collaborator

mrousavy commented Oct 30, 2020

🐛 Bug Report

⚠️ First off: I think this is related to #6728.

When animating Shared Element Transitions to a view that is transformed in some sort (translateX in my case, but might also be scale, translateY, ...), the Shared Element Transitions weirdly miscalculates the destination coordinates at first, but manages to get it right halfway through. Yes, that's my explanation. It's weird, take a look at it yourself:

📹 Here's a video demo: https://i.imgur.com/tNcQwD1.mp4

So in this example, I'm translating the parent view across the X axis, so first Post is translateX: 0 which works perfectly fine. Second post is translateX: -SCREEN_WIDTH, which already looks a bit off. And then it just goes on, with the animation going further to the origin point (0 aka "left") the more you translate x.

To Reproduce

  1. Create parent view that translates X axis
  2. Create list of views in that translated view (Shared Elements)
  3. Push a Modal with SETs that animates the Shared Element (image)
  4. Dismiss the modal with the SET

Expected behavior

I expect the animation to work normally

Actual Behavior

The animation swiftly goes towards the origin (0 aka "left"), then finds out it's a bit drunk and finds it's way back home (actual position)

Your Environment

  • React Native Navigation version: master (snapshot)
  • React Native version: 0.63.3
  • Platform(s) (iOS, Android, or both?): iOS

Reproducible Demo

@yogevbd hit me up on discord for a repro demo

Related Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants