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

FlatList snapToOffsets doesn't always work when two FlatLists are rendered side-by-side #49209

Open
troberts-28 opened this issue Feb 5, 2025 · 0 comments

Comments

@troberts-28
Copy link

Description

When more than one FlatLists are rendered together in a View side-by-side, one of the FlatLists does not observe its snapToOffsets (or snapToInterval).

It appears to be related to the FlatList layout because setting certain fixed widths on one/both of the FlatLists can shift the problem to the other FlatList or fix the issue entirely, though I have not been able to work out any pattern as to why certain widths change the behaviour.

Steps to reproduce

  1. Run the Expo Snack on an iOS device (not emulator).
  2. Scroll each FlatList and notice how one snaps and the other does not (despite them being identical).

React Native Version

0.76.6

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
  CPU: (8) x64 AMD Ryzen 7 4700U with Radeon Graphics
  Memory: 7.96 GB / 15.01 GB
  Shell:
    version: 5.2.21
    path: /bin/bash
Binaries:
  Node:
    version: 21.1.0
    path: ~/.nvm/versions/node/v21.1.0/bin/node
  Yarn:
    version: 3.6.4
    path: ~/.nvm/versions/node/v21.1.0/bin/yarn
  npm:
    version: 10.9.2
    path: ~/.nvm/versions/node/v21.1.0/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.14
    path: /usr/bin/javac
  Ruby:
    version: 3.1.2
    path: /home/troberts28/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.6
    wanted: 0.76.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

N/A

Reproducer

https://snack.expo.dev/@nuumi/flatlist-snap-issue

Screenshots and Videos

WhatsApp.Video.2025-02-05.at.16.15.32.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants