Giter Site home page Giter Site logo

Comments (5)

JaviEzpeleta avatar JaviEzpeleta commented on May 13, 2024 11

Hi @tafelito,
I was experiencing the same problem as you,
1 or 2 times every 5 transitions it wasn't positioning the image correctly.
In case this solution is fine for you: I tried adding the cardStyleInterpolator option to the Detail Screen, so it fades from the list to the detail, and it works 100% of the time!

I just used the example found at https://reactnavigation.org/docs/stack-navigator/#cardstyleinterpolator

in the <Navigator> component, I defined this function:

const forFade = ({ current, closing }) => ({
  cardStyle: {
    opacity: current.progress,
  },
})

and then I just added the option to the Screen on that same file:

        <Stack.Screen
          ...
          options={{ cardStyleInterpolator: forFade }}
          ... >

...hope it helps!

from react-navigation-shared-element.

IjzerenHein avatar IjzerenHein commented on May 13, 2024

Hmm, not sure might be related to #24 Could you try and see whether this workaround works?
#24 (comment)

from react-navigation-shared-element.

tafelito avatar tafelito commented on May 13, 2024

I tried changing the transitionSpec as you suggested. Even tho it works most of the time, it did fail 1 or 2 times. What I did notice is that now the navigation seems to be a bit laggy, specially when you swipe back.

I think that if you start the swipe back before the transitions ends, that's when it fails or you can see the lag

Is the shared transition supposed to happen when swiping back and not with the back on the header?

Mar-19-2020 10-20-42

from react-navigation-shared-element.

kdo1234 avatar kdo1234 commented on May 13, 2024

@JaviEzpeleta's fix worked for me as well. Thank you

from react-navigation-shared-element.

IjzerenHein avatar IjzerenHein commented on May 13, 2024

Hi! Please upgrade to the latest official version. Lots of things have been fixed and the native extensions have also received a bunch of bug fixes. Feel free to reopen with a PR for a test-case in the example app when this problem still occurs.

from react-navigation-shared-element.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.