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

Quickly scrolling to the top of ScrollViews on Android 14 can result in negative offsets #41034

Open
LegendEffects opened this issue Oct 17, 2023 · 8 comments
Labels
Component: ScrollView Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: Android Android applications.

Comments

@LegendEffects
Copy link

LegendEffects commented Oct 17, 2023

Description

On Android 14, quickly scrolling to the top of a ScrollView can result in a negative offset. See snack and attached video.

This bug is still present without the code to display the offset.

screen-20231017-1636562.mp4

React Native Version

0.72.6

Output of npx react-native info

System:
  OS: macOS 14.0
  CPU: (8) arm64 Apple M1
  Memory: 271.27 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.5.1
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 9.8.0
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2023.08.14.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.0
      - iOS 17.0
      - macOS 14.0
      - tvOS 17.0
      - watchOS 10.0
  Android SDK:
    API Levels:
      - "26"
      - "30"
      - "31"
      - "33"
    Build Tools:
      - 29.0.2
      - 29.0.3
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 34.0.0
    System Images:
      - android-26 | Google APIs ARM 64 v8a
      - android-27 | Google APIs ARM 64 v8a
      - android-28 | Google APIs ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 15.0/15A240d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.6
    wanted: 0.72.6
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to reproduce

  1. Create a scroll view with enough content for it to scroll
  2. Scroll down a bit and then scroll quickly to the top

Snack, screenshot, or link to a repository

https://snack.expo.dev/@evanb/android-scroll-view-bug

screen-20231017-1636562.mp4
@LegendEffects LegendEffects changed the title ScrollViews on Android 14 can result in negative offsets Quickly scrolling top the top of ScrollViews on Android 14 can result in negative offsets Oct 17, 2023
@LegendEffects LegendEffects changed the title Quickly scrolling top the top of ScrollViews on Android 14 can result in negative offsets Quickly scrolling to the top of ScrollViews on Android 14 can result in negative offsets Oct 17, 2023
@LegendEffects
Copy link
Author

LegendEffects commented Oct 27, 2023

Hello, is there anything that can be done to get this moving? I noticed that this issue hasn't been marked as having a repro despite the expo snack, is it invalid or something?

@DevMassive
Copy link

Seems to be an issue with the overscroll effect in Android 14.
https://issuetracker.google.com/issues/286422637

I reproduced it in an Android app without React Native.

@LegendEffects
Copy link
Author

Seems to be an issue with the overscroll effect in Android 14. https://issuetracker.google.com/issues/286422637

I reproduced it in an Android app without React Native.

Can confirm that this seems to be an issue with Android itself, I managed to find it present in the Fitbit app which I doubt is made in React Native. Concerning that the linked issue was submitted during the beta phase and is marked as fixed when it's present in the production build.

I'll leave this open unless someone else closes it, just for people currently finding this issue.

@krmao
Copy link

krmao commented Nov 7, 2023

google pixel 7 pro with android version 14 still have this bug.

"react-native": "0.72.4"

@cyberkaidev
Copy link

cyberkaidev commented Jan 4, 2024

I have same problem.
I noticed this happens on IOS and Android 12.
It's as if VirtualizedList/ScrollView/FlatList tries to correct the initial position when I scroll to the top.

@robinplace
Copy link

two more reports:

  1. mine just now, here on github scrollview glitches after overscrolling to the top of view #43736.
  2. on stackoverflow back in november.

@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 labels Apr 2, 2024
@cortinico
Copy link
Contributor

another reproducer is also here #43736 (comment)

@MaskedHawk
Copy link

I'm still struggling with the same issue. How did you guys handle the situation? Did you set overScrollMode to never or did you use another solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ScrollView Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: Android Android applications.
Projects
None yet
Development

No branches or pull requests

7 participants