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 Transition does not take current scale into account #5475

Open
mrousavy opened this issue Dec 7, 2023 · 2 comments
Open

Shared Element Transition does not take current scale into account #5475

mrousavy opened this issue Dec 7, 2023 · 2 comments
Labels
Area: Shared Element Transitions Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@mrousavy
Copy link
Contributor

mrousavy commented Dec 7, 2023

Description

Hey all!

I've noticed a small bug in Shared Element Transitions, where the Animation does not take the current scale into account. See this video recording:

RPReplay_Final1701958592-2.mp4

You might want to watch this in QuickTime and go through this frame by frame - but as you can see I drag down the view to this scale:

...where it should start animating from. If we go to the next frame, we can see that the animation does not start at that scaled down state, but rather at the original scale:

...and then just scales down from that to it's target position.

It does work for the translation (it starts at the correct originY and originY), but not for scale. Both translation and scale are passed in the same parent view's style.

Steps to reproduce

  1. Create Shared Element Transition
  2. Scale down the View that contains the shared element
  3. Run shared element transition at scaled down state
  4. Notice that it does not start at scaled down state, but rather at scale 1.

Snack or a link to a repository

https://github.com/mrousavy/react-native-reanimated/tree/repro/shared-element-transition-bugs

Reanimated version

3.6.1

React Native version

0.72.7

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

Debug app & dev bundle

Device

Real device

Device model

iPhone 11 Pro

Acknowledgements

Yes

@mrousavy mrousavy added the Needs review Issue is ready to be reviewed by a maintainer label Dec 7, 2023
@github-actions github-actions bot added Repro provided A reproduction with a snippet of code, snack or repo is provided Platform: iOS This issue is specific to iOS labels Dec 7, 2023
@mrousavy
Copy link
Contributor Author

mrousavy commented Dec 7, 2023

Okay - just created a minimal reproduction! I just updated the "[SET] Custom transition" example in the Reanimated playground in my branch here: https://github.com/mrousavy/react-native-reanimated/tree/repro/shared-element-transition-bugs

Simulator.Screen.Recording.-.iPhone.15.-.2023-12-07.at.15.35.27.mp4

@tomekzaw tomekzaw added Area: Shared Element Transitions and removed Needs review Issue is ready to be reviewed by a maintainer labels Dec 7, 2023
@Laityned
Copy link

Laityned commented Jul 3, 2024

As an addition, I noticed that transformations applied to any parent element are also not taking into account. Therefore, transistion is happening from its original location and not from his current location

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Shared Element Transitions Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests

3 participants