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] Over-zealous applying of progressViewOffset prevents UIScrollView/UIRefreshControl OS behavior #35283

Closed
objectivecosta opened this issue Nov 9, 2022 · 2 comments
Labels
Component: RefreshControl Component: ScrollView Needs: Triage 🔍 Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@objectivecosta
Copy link
Contributor

Description

UIRefreshControl has a tight integration with iOS in terms of UINavigationBar/UIScrollView. In this regard, whenever there's a UIScrollView with a UINavigationBar on top, the OS automatically adjusts the contentInset of the UIScrollView to reflect that (something that is exposed to React Native). In a similar manner, UIScrollView passes this along to the attached UIRefreshControl.

On RCTRefreshControl, by always applying the progressViewOffset (which in turn, changes the .frame property of the view), this behavior is broken, resulting in non-native experience.

Bug Expected

This is fixed by #35281

Version

0.70.5

Output of npx react-native info

info Fetching system and libraries information...
System:
OS: macOS 13.0
CPU: (8) arm64 Apple M1
Memory: 91.36 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
Yarn: Not Found
npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
Watchman: Not Found
Managers:
CocoaPods: Not Found
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8609683
Xcode: 14.1/14B47b - /usr/bin/xcodebuild
Languages:
Java: 17.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: ^18.1.0 => 18.1.0
react-native: ^0.70.5 => 0.70.5
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

  • Insert a NavigationController into the view hierarchy (using ReactNavigation or by doing it natively)
  • Within ReactNative, create a ScrollView
  • Attach a RefreshControl to it

Observe the ScrollView adjusts correctly (when told to do so via the contentInsetAdjustmentBehavior="automatic" property) but this adjustment does not reflect on the RefreshControl, due to this bug

Snack, code example, screenshot, or link to a repository

Example of repro in the reproducer:
Simulator Screen Recording - iPhone 14 Pro Max - 2022-11-09 at 13 39 04

Reproducer: https://github.com/objectivecosta/RCTRefreshControlBugReproducer

@github-actions
Copy link

github-actions bot commented May 8, 2023

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label May 8, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: RefreshControl Component: ScrollView Needs: Triage 🔍 Platform: iOS iOS applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants