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] scrollTo() can scroll past the child contents #22768

Closed
3 tasks done
cabelitos opened this issue Dec 23, 2018 · 1 comment
Closed
3 tasks done

[iOS] scrollTo() can scroll past the child contents #22768

cabelitos opened this issue Dec 23, 2018 · 1 comment
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@cabelitos
Copy link
Contributor

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14.2
      CPU: x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
      Memory: 183.48 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.14.0 - /opt/local/bin/node
      Yarn: 1.12.3 - /opt/local/bin/yarn
      npm: 6.5.0 - /opt/local/bin/npm
      Watchman: 4.9.0 - /opt/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
      Android SDK:
        Build Tools: 23.0.1, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.3, 28.0.0, 28.0.1, 28.0.2, 28.0.3
        API Levels: 23, 25, 26, 27, 28
    IDEs:
      Android Studio: 3.2 AI-181.5540.7.32.5014246
      Xcode: 10.1/10B61 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.6.3 => 16.6.3
      react-native: 0.57.8 => 0.57.8

Description

On iOS if one uses the scrollTo()/scrollToOffset() family of functions and the offset provided is bigger than the actual content, the content will disappears from the screen and will only be visible again if the user interacts with the UI again. It's important to note that this behavior does not occur on Android, therefore both platforms should behave equally.

Reproducible Demo

1 - Go to https://snack.expo.io/@cabelitos/scroll-problem
2 - Run the project on an iOS simulator.
3 - After 2 seconds the scrollToOffset() function will be called with an offset bigger than the content.
4 - The screen will be white after the function executes.

One can execute the same app on an Android emulator and will notice that the app will stop at the last item and will not advance any further.

iOS behavior

iOS scroll problem

Android behavior

Android

@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Dec 23, 2018
@hramos hramos removed the Bug Report label Feb 6, 2019
facebook-github-bot pushed a commit that referenced this issue Feb 21, 2019
Summary:
Fix scrollview `offset` out of content size in iOS, Android uses `scrollTo` and `smoothScrollTo` which not have this issue.

Fixes like #13594 #22768 #19970 .

[iOS] [Fixed] - Fixed scrollView offset out of content size.
Pull Request resolved: #23427

Differential Revision: D14162663

Pulled By: cpojer

fbshipit-source-id: a95371c8d703b6d5f604af0072f86c01c2018f4a
mbardauskas pushed a commit to mbardauskas/react-native that referenced this issue Feb 21, 2019
Summary:
Fix scrollview `offset` out of content size in iOS, Android uses `scrollTo` and `smoothScrollTo` which not have this issue.

Fixes like facebook#13594 facebook#22768 facebook#19970 .

[iOS] [Fixed] - Fixed scrollView offset out of content size.
Pull Request resolved: facebook#23427

Differential Revision: D14162663

Pulled By: cpojer

fbshipit-source-id: a95371c8d703b6d5f604af0072f86c01c2018f4a
grabbou pushed a commit that referenced this issue Mar 22, 2019
Summary:
Fix scrollview `offset` out of content size in iOS, Android uses `scrollTo` and `smoothScrollTo` which not have this issue.

Fixes like #13594 #22768 #19970 .

[iOS] [Fixed] - Fixed scrollView offset out of content size.
Pull Request resolved: #23427

Differential Revision: D14162663

Pulled By: cpojer

fbshipit-source-id: a95371c8d703b6d5f604af0072f86c01c2018f4a
@cpojer
Copy link
Contributor

cpojer commented Apr 2, 2019

This will be fixed in 0.60.

@cpojer cpojer closed this as completed Apr 2, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Apr 2, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants