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

return final animation values to JS for native driven animations #36731

Closed
wants to merge 1 commit into from

Commits on Mar 31, 2023

  1. return final animation values to JS when animation completes (faceboo…

    …k#36731)
    
    Summary:
    Pull Request resolved: facebook#36731
    
    When using the native driver for animations that involve layout changes (ie. translateY and other transforms, but not styles such as opacity), because it bypasses Fabric, the new coordinates are not updated so the Pressability responder region/tap target is incorrect
    
    **This diff:**
    - Returning the final values from the native side, at the same place it sets the "finished" flag. This gets sent to JS in `animated/animations/Animation.js`. In this diff I'm passing the value when 'hasFinishedAnimations' is true, but in a follow up diff I will look into other cases such as cancelled animations
    
    Next:
    2. Update the Animated.Value to reflect the new values
    3. Call the onEnd function if there is one set
    4. Use `setNativeProps` to pass the new values down for layout calculations and the correct Pressability responder region
    
    Changelog:
    [General][Changed] - return animated values to JS for natively driven animations
    
    Differential Revision: D44110833
    
    fbshipit-source-id: 3418aed9ae724d33dcedb0e678a7e5b4c89ca65e
    skinsshark authored and facebook-github-bot committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    f81aa00 View commit details
    Browse the repository at this point in the history