facebook / react-native

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

Sticky views have visual glitches while scrolling in ScrollView #45546

Open MichailShcherbakov opened 1 month ago

MichailShcherbakov commented 1 month ago

Description

The views that specified as "sticky" in ScrollView have visual glitches while scrolling programmatically.

Steps to reproduce

  1. Install the Snack on a physical device
  2. Press the "Scroll to 1000" button
  3. Press the "Scroll to 5000" button

React Native Version

0.74.3

Affected Platforms

Runtime - Android, Build - Linux

Output of npx react-native info

System:
  OS: Linux 5.15 Arch Linux
  CPU: (8) x64 Intel(R) Core(TM) i3-10100F CPU @ 3.60GHz
  Memory: 5.20 GB / 7.71 GB
  Shell:
    version: 5.2.26
    path: /usr/bin/bash
Binaries:
  Node:
    version: 20.15.1
    path: ~/.nvm/versions/node/v20.15.1/bin/node
  Yarn:
    version: 1.22.22
    path: ~/.nvm/versions/node/v20.15.1/bin/yarn
  npm:
    version: 10.8.2
    path: ~/.nvm/versions/node/v20.15.1/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java: Not Found
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.3
    wanted: 0.74.3
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

None

Reproducer

https://snack.expo.dev/@michail_shcherbakov/sticky-view-glitches

Screenshots and Videos

https://github.com/user-attachments/assets/9b93783e-4d85-4000-bcec-87870cfd1446

MichailShcherbakov commented 1 month ago

It looks like this is a problem specific to Android. There is no such problem on iOS devices.