facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
117.35k stars 24.12k forks source link

scrollview glitches after overscrolling to the top of view #43736

Closed robbiewxyz closed 3 months ago

robbiewxyz commented 3 months ago

Description

on android, overscrolling at the top of a view currently allows one to scroll about 10 pixels past the top of container. this results in a 10 pixel "snap" on the next scroll gesture.

this can be reporduced easily using:

  1. the example at https://reactnative.dev/docs/scrollview#example.
  2. the example at https://reactnative.dev/docs/virtualizedlist#example.
  3. and probably others.

see this stackoverflow question from last november.

Steps to reproduce

  1. go to https://reactnative.dev/docs/scrollview#example.
  2. click "my device" and scan the QR code with the latest version, 50.0, of the expo app.
  3. scroll down in the text about half a screen.
  4. quickly fling scroll back up to the top.
  5. slowly scroll down again.

you'll observe on slowly scrolling down again that the view quickly "snaps" down 10 pixels or so.

React Native Version

0.73.6

Affected Platforms

Runtime - Android

Output of npx react-native info

n/a.

Stacktrace or Logs

n/a.

Reproducer

https://snack.expo.dev/VeDA0dtNo3kiBzKQUuKMH

Screenshots and Videos

https://github.com/facebook/react-native/assets/7308014/37fb8890-f4b9-4c00-b19d-01cd81e3720e

robbiewxyz commented 3 months ago

ah. this duplicates https://github.com/facebook/react-native/issues/41034.