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

[iOS] Scrollviews inside row doesn't fire onMomentumScrollEnd #46592

Closed
GuilhermeHCDias opened this issue Sep 21, 2024 · 13 comments
Closed

[iOS] Scrollviews inside row doesn't fire onMomentumScrollEnd #46592

GuilhermeHCDias opened this issue Sep 21, 2024 · 13 comments
Assignees
Labels
Component: ScrollView Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@GuilhermeHCDias
Copy link

Description

I tried to reproduce this same issue with the "old" architecture, and it works correctly, even though there's a closed issue due to inactivity (#32592) that describes this problem. However, it functions correctly in the old architecture. This issue only occurs in the new architecture.

When inserting 3 or more ScrollViews inside a View that has the style: flex-direction: 'row', the onMomentumScrollEnd event is not triggered in one of the ScrollViews. The snapToInterval also doesn't work correctly, and is ignored. I imagine snapToInterval relies on onMomentumScrollEnd or something similar to it.
For some reason, if the ScrollView container takes up the full width of the device, the bug doesn't occur.

  1. If you use any horizontal padding, the bug occurs.

  2. If you place any element next to the ScrollViews, the bug occurs.

  3. If you use margin, the bug doesn't occur.

In my reproduction, I included all these examples. Perhaps it is something related to the contentContainer of the ScrollView? I'm not sure. I tried reproducing as many scenarios as possible to reach a conclusion.

The bug occurs in Android and iOS(I don't tested in other devices)

Steps to reproduce

  1. run yarn.
  2. run yarn pod-install if you want to use iOS devices.
  3. run yarn android or yarn ios.
  4. Scroll any of the rendered ScrollViews, each one exhibits the described issue.

React Native Version

0.75.3

Affected Platforms

Runtime - Android, Runtime - iOS

Areas

JSI - Javascript Interface

Output of npx react-native info

System:
  OS: macOS 15.0
  CPU: (10) arm64 Apple M2 Pro
  Memory: 786.73 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.14.0
    path: /usr/local/bin/node
  Yarn:
    version: 3.6.4
    path: /usr/local/bin/yarn
  npm:
    version: 10.7.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.08.12.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12169540
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 21.0.4
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.3
    wanted: 0.75.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

don't have

Reproducer

https://github.com/GuilhermeHCDias/new-arch-scrollview-bug

Screenshots and Videos

Screenshot 2024-09-21 at 12 29 39

@GuilhermeHCDias GuilhermeHCDias added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Sep 21, 2024
@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 labels Sep 23, 2024
@GuilhermeHCDias
Copy link
Author

up

@coado
Copy link
Collaborator

coado commented Oct 1, 2024

Hey @GuilhermeHCDias, the repro seems to be a default starting react native app. I think you might forget to push the changes.

@cortinico cortinico added Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. labels Oct 1, 2024
@react-native-bot
Copy link
Collaborator

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:

@GuilhermeHCDias
Copy link
Author

Hey @GuilhermeHCDias, the repro seems to be a default starting react native app. I think you might forget to push the changes.

You're right, man! So sorry, i've pushed the updates. Thank you!

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Oct 2, 2024
@coado
Copy link
Collaborator

coado commented Oct 3, 2024

@GuilhermeHCDias I am not sure if I understand that correctly, but it seems like the onMomentumScrollEnd is called on each of the scroll views on the red examples. I've checked that on Fabric bridgeless, Fabric and old arch. I might misunderstand something, so could you please clarify the problem?

scrollviews-issue-recording.mov

@GuilhermeHCDias
Copy link
Author

@GuilhermeHCDias I am not sure if I understand that correctly, but it seems like the onMomentumScrollEnd is called on each of the scroll views on the red examples. I've checked that on Fabric bridgeless, Fabric and old arch. I might misunderstand something, so could you please clarify the problem?

scrollviews-issue-recording.mov

So, what happens is that some scrollviews don’t trigger, while others do. If I perform the movement abruptly, it triggers, but if I do it slowly, it doesn’t. I’m running the example on an iPhone 16 Pro, but it happens on other devices as well. Is something with snapToInterval or onMomentumScrollEnd. Thank you for your try

Screen.Recording.2024-10-03.at.10.56.36.mov

@coado
Copy link
Collaborator

coado commented Oct 3, 2024

@GuilhermeHCDias I can see the problem now, thanks!

@GuilhermeHCDias
Copy link
Author

I’ve also tested it on other versions, including the latest unstable release (0.76.0-rc.3), but the issue still persists.

@coado
Copy link
Collaborator

coado commented Oct 4, 2024

I’ve also tested it on other versions, including the latest unstable release (0.76.0-rc.3), but the issue still persists.

mhm and you also see this issue happen on Android? It seems to be fine there 🤔

@GuilhermeHCDias
Copy link
Author

mhm and you also see this issue happen on Android? It seems to be fine there 🤔

Sorry for the delay, I’ve been swamped lately. I tested it again on Android, and the bug didn’t show up this time, but it’s weird because I remember seeing it happen before on Android too.

@GuilhermeHCDias
Copy link
Author

GuilhermeHCDias commented Oct 5, 2024

Yeah, man, you’re right! This doesn’t happen on Android, i've tested on 3 different Android versions on 3 different devices.

  • Pixel 7
  • Samsung Galaxy Note 20
  • Redmi Note 7

@coado
Copy link
Collaborator

coado commented Oct 7, 2024

Yeah, man, you’re right! This doesn’t happen on Android, i've tested on 3 different Android versions on 3 different devices.

  • Pixel 7
  • Samsung Galaxy Note 20
  • Redmi Note 7

Awesome! Thank you so much for also checking this out 😁

@cortinico cortinico added the Platform: iOS iOS applications. label Oct 7, 2024
@cortinico cortinico changed the title Scrollviews inside row doesn't fire onMomentumScrollEnd [iOS] Scrollviews inside row doesn't fire onMomentumScrollEnd Oct 7, 2024
@GuilhermeHCDias
Copy link
Author

Thank you for updates ♥️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: ScrollView Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants