question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Offsetting RefreshControl on iOS via progressViewOffset

See original GitHub issue

Description

An object class check for RefreshControl is hard-coded into ScrollView making it impossible to offset the pull-to-refresh loader via JS. Tinkering with the style prop on RefreshControl can cause crashes and strange visual artifacts. A native solution seems the only near-term viable option besides re-implementing everything from scratch.

I have a fix locally to make the Android-only property progressViewOffset on RefreshControl work on iOS as well.

I will submit a PR as soon as possible. Please reply here if there is any disinterest in resolving this issue by adding iOS support via progressViewOffset

Reproduction

  1. Start a project
  2. Set up a <ListView> component
  3. Add the refreshControl={<RefreshControl progressViewOffset={-13}/>} property.
  4. Run in iOS simulator
  5. Pull-down while list is at top
  6. An activity indicator will slowly appear as you pull down.

The indicator does not move according to the progressViewOffset property on RefreshControl.

Additional Information

  • React Native version: 0.36
  • Platform: iOS 10.0
  • Operating System: macOS 10.12.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
hramoscommented, May 25, 2018

@Bonobomagno happy to re-open the issue if you are ready to send a PR.

2reactions
mountainmooncommented, May 17, 2017

This is a very usefull feature, why it has not be merged till now ? @scarlac @brentvatne

Read more comments on GitHub >

github_iconTop Results From Across the Web

Offsetting RefreshControl on iOS via progressViewOffset | Voters
property. Run in iOS simulator; Pull-down while list is at top; An activity indicator will slowly appear as you pull down. The indicator ......
Read more >
ProgressViewOffset for IOS Refresh Control React Native
It's working fine on Android. But in IOS we have no support for offset. But I ended up using contentInset and contentOffset but...
Read more >
[Solved]-How to offset the RefreshControl - appsloveworld
In android you can use parameter 'progressViewOffset' to a value to achieve the same. <RefreshControl refreshing={this.state.isRefreshing} onRefresh={this.
Read more >
RefreshControl - React Native
This component is used inside a ScrollView or ListView to add pull to refresh functionality. When the ScrollView is at scrollY: 0 ,...
Read more >
React Native Pull-to-Refresh: Make Refreshing Easy for Users
While using RefreshControl, you'll need to handle the state of the component. ... progressViewOffset: the top offset of the progress view.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found