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

RefreshControl showing issue on RN 0.27 #7976

Closed
Bhullnatik opened this issue Jun 7, 2016 · 23 comments
Closed

RefreshControl showing issue on RN 0.27 #7976

Bhullnatik opened this issue Jun 7, 2016 · 23 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@Bhullnatik
Copy link
Contributor

I have an issue with RefreshControl with React Native 0.27.x on iOS. The RefreshControl is creeping up on the top right side of my view until I use it the first time:

simulator screen shot jun 7 2016 3 11 18 pm

The weird thing is that if I don't pass the tintColor prop, it works great.

Here is my RefreshControl:

<RefreshControl
  refreshing={isRefreshing}
  onRefresh={this.handleRefresh.bind(this)}
  tintColor={Colors.RED1}
  colors={[Colors.BLUE1, Colors.RED1, Colors.ORANGE1]}
  progressBackgroundColor={Colors.WHITE1} />

cc @janicduplessis

@dozoisch
Copy link
Contributor

dozoisch commented Jun 7, 2016

I'm getting the exact same thing in iOS simulator.

Using:

              <RefreshControl
                refreshing={this.state.refreshing}
                onRefresh={this.handleRefresh}
                title="Refresh"
              />

It disappears once the view gets touched.

@agat
Copy link

agat commented Jun 8, 2016

Temporary fix — remove title property from RefreshControl.

@marcosinigaglia
Copy link

Same issue, I fix removing tintColor prop.

@janicduplessis
Copy link
Contributor

Do you know if this issue only happens since 0.27?

@Bhullnatik
Copy link
Contributor Author

@janicduplessis I'm not sure, we skipped 0.26.x versions due to various bugs. 0.25.x was working fine.

@dozoisch
Copy link
Contributor

dozoisch commented Jun 8, 2016

@janicduplessis I was on 0.26.3 before it was fine! Without the title attribute it doesn't happen anymore.

@ide ide mentioned this issue Jun 8, 2016
4 tasks
@nickeliah1
Copy link

Same issue here with tintColor

@zerko
Copy link

zerko commented Jun 14, 2016

@janicduplessis it is 0.27 only issue.

@lisong
Copy link

lisong commented Jun 22, 2016

0.28.0 happens too!

@vanBrunneren
Copy link

I'm facing this issue with RN 28.0 even if I remove tintColor and title:

<ListView
    renderSectionHeader={this._renderSectionHeader.bind(this)}
    refreshControl={
        <RefreshControl
            refreshing={this.state.isRefreshing}
            onRefresh={this._onRefresh.bind(this)}                          
            />
    }
    onEndReached={ () => this._onEndReached() } 
    dataSource={this.state.dsHomeViewList}
    renderHeader={this._renderHeader.bind(this)}
    renderRow={this._renderHomeList.bind(this)}
    renderFooter={this._renderFooter.bind(this)} />

juni-27-2016 14-41-10

does anyone has a working temporary (or better a stable) fix for this?

@magrinj
Copy link
Contributor

magrinj commented Jun 28, 2016

As a temporary fix I just set the background color of my row, or header or whatever you have at the top of the list view on your app. I take a look in the RefreshControl class and in native component and I can't see anything different since the 0.27, maybe something change in the style engine.

@plrthink
Copy link
Contributor

plrthink commented Jul 4, 2016

same issue here with just passing refreshing and onRefresh props to RefreshControl on [email protected].

@plrthink
Copy link
Contributor

plrthink commented Jul 4, 2016

my app has two tab bar at the bottom and each one will render its own listview. what's interesting is that this problem only occurs when I switch the listview and then switch back. It looks like the upper two screenshots also have this kind of layout.

screen shot 2016-07-04 at 16 59 54

@tofrookie
Copy link

how to fix it

@yanfeng42
Copy link
Contributor

yanfeng42 commented Jul 8, 2016

@tofrookie @plrthink Test iOS With 0.29.0 , solve this by backgroundColor,

<RefreshControl
           style={{
             backgroundColor:'#0000',
           }}
          refreshing={this.state.refreshing}
           />

@TanTan-TT
Copy link

<RefreshControl
           style={{
             backgroundColor:'transparent',
           }}
          refreshing={this.state.refreshing}
           />

Setting backgroundColor to transparent is worked for me

@rclai
Copy link
Contributor

rclai commented Jul 15, 2016

I'm on 0.29.1 and it's happening to me.

Setting style={{ backgroundColor: 'transparent' }} fixed it for me.

@messense
Copy link

messense commented Aug 2, 2016

Same issue on 0.30.0

@ghuh
Copy link

ghuh commented Aug 3, 2016

Same issue on 0.31.0-rc.0 while only passing in refreshing and onRefresh. Setting backgroundColor to transparent seems to have fixed the issue.

@janicduplessis
Copy link
Contributor

It would be great if someone has time to investigate why this is happening as I don't have much time to look at this at the moment, seems like a really weird bug. We could always set the background color to transparent as a workaround but this doesn't seem ideal.

There is also iOS 10 that bring first class support for UIRefreshControl in any UIScrollView so we might also want to try implementing RefreshControl with this technique and fallback on what we are doing now on iOS 9-. Hopefully that will fix most of the weird RefreshControl bugs and avoid having a bunch of hacky code to try to patch it.

GantMan added a commit to GantMan/react-native that referenced this issue Aug 5, 2016
@GantMan
Copy link
Contributor

GantMan commented Aug 5, 2016

This bug has persisted for a very long time and is actually part of several apps for us now. So I submitted a PR in the hopes of assuaging our pain until @janicduplessis et. al. find a better way.

joehoyle added a commit to joehoyle/vienna that referenced this issue Aug 23, 2016
This fixed a bug in react native that causes it to show in the top
right, see facebook/react-native#7976
ghost pushed a commit that referenced this issue Sep 4, 2016
Summary:
Refresh bug #7976
This bug has persisted for 3 versions of React Native.   Currently everyone is having to do a silly fix, documented in the bug.   I spent an hour trying to find the source of the bug.   Failing to find the issue quickly, I've just decided to make this simple bugfix.

According to janicduplessis #7976 we will likely be re-writing this control in iOS 10.
Closes #9249

Differential Revision: D3817227

fbshipit-source-id: f98282aadeca3e85239836f589eda901d454f2ce
@GantMan
Copy link
Contributor

GantMan commented Sep 8, 2016

@Bhullnatik - you can close this, my PR was accepted, this will be fixed.

@uc-asa
Copy link

uc-asa commented Dec 6, 2016

I'm using 0.30
<RefreshControl
refreshing={ this.state.isRefreshing }
onRefresh={() => this._onRefresh()}
style={{
backgroundColor : 'transparent',
}}
tintColor="#ccc"
title="Loading..."
titleColor="#5a6d7d"
colors={['#ff0000', '#00ff00', '#0000ff']}
progressBackgroundColor="#ffff00"
/>

It works for me

@facebook facebook locked as resolved and limited conversation to collaborators Jul 19, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
react-one pushed a commit to react-one/react-native that referenced this issue Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests