Skip to content

【Android】:Animated.event does not update latest contentOffset.y on onScroll Event When useNativeDriver is set to true #52657

Open

Description

@yandadaFreedom

Description

I want to implement a stickyHeader component that relies on the scroll event of the scrollView to get the latest contentOffset.y. Then, by listening to the changes in y, I can set the translateY property of the stickyHeader.

However, when the content height of the scrollView changes dynamically, especially when it decreases, using addListener to track the animation value changes, we find that when useNativeDriver is set to true, Animated.event sometimes fails to update the latest contentOffset.y value. The listener callback of Animated.event prints e.nativeEvent.contentOffset.y as the latest value, but printing animatedValue.__getValue still shows the previous value.

Unfortunately, we cannot trigger the animation value change in the listener callback of Animated.event, as that would cause the sticky animation to flicker.

Image

Steps to reproduce

  1. Install the app.
  2. Click on tab1 and scroll the scroll-view content to the bottom.
  3. Click on tab2.
  4. Repeat steps 2 and 3 to reproduce the issue.

I cannot reproduce the issue in the emulator; it only occurs sporadically on a real device.

React Native Version

0.80.1

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

ystem:
  OS: macOS 14.2.1
  CPU: (8) arm64 Apple M3
  Memory: 137.05 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.10.0
    path: ~/.nvm/versions/node/v23.10.0/bin/node
  Yarn:
    version: 1.22.22
    path: /usr/local/bin/yarn
  npm:
    version: 10.9.2
    path: ~/.nvm/versions/node/v23.10.0/bin/npm
  Watchman:
    version: 2024.10.21.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.3 AI-233.14808.21.2331.11709847
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 3.1.0
    path: /Users/didi/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 19.0.0
    wanted: 19.0.0
  react:
    installed: 19.1.0
    wanted: 19.1.0
  react-native:
    installed: 0.80.1
    wanted: 0.80.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

no logs

MANDATORY Reproducer

https://github.com/yandadaFreedom/reproducer-react-native-0.80.1/tree/bug-animated-event

Screenshots and Videos

The issue is reproduced at the 35-second mark in the video.

249_1752737057.mp4

Activity

  1. cortinico commented on Jul 17, 2025

    @cortinico
    Contributor

    Is this a New Architecture regression?

  2. yandadaFreedom commented on Jul 17, 2025

    @yandadaFreedom
    Author

    Is this a New Architecture regression?

    this appears to be related to New Architecture. The issue occurs on Android where newArchEnabled: true, but I haven't tested extensively on the old architecture yet.

  3. Sameed1998 commented on Jul 18, 2025

    @Sameed1998

    Have you fixed this issue?

  4. yandadaFreedom commented on Jul 21, 2025

    @yandadaFreedom
    Author

    Have you fixed this issue?

    No, I don't know how to fix it 😂

  5. react-native-bot commented on Jan 17, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  6. react-native-bot commented on Jan 17, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.

  7. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    and removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Jan 17, 2026
  8. yandadaFreedom commented on Mar 18, 2026

    @yandadaFreedom
    Author

    up

  9. react-native-bot commented on Sep 15, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  10. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    and removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions