Topener / nl.fokkezb.pullToRefresh

Widget to implement a table pull-to-refresh header in Titanium Alloy
184 stars 60 forks source link

Widget disappears from table inside scrollview #49

Closed ruscles closed 9 years ago

ruscles commented 9 years ago

I have a table with the widget wrapped around it and both of those are inside a scrollview. When I open a window from that view and then return to the view with the widget, the widget disappears. The widget is working correctly before it disappears.

<Alloy> 
    <View id="standardview">
        <ScrollView id="incidentScrollView" showVerticalScrollIndicator="true">
            <Widget id="ptr" src="nl.fokkezb.pullToRefresh" onRelease="myRefresher">
                <TableView id="incidentTable" backgroundColor="transparent"/>
            </Widget>
        </ScrollView>
    </View>
</Alloy>

If I remove the scrollview and just have the widget and table, the widget will refresh as soon as the table is pulled down any distance, it will not refresh onRelease. The widget does not disappear, but it is not working correctly.

<Alloy> 
    <View id="standardview">
        <Widget id="ptr" src="nl.fokkezb.pullToRefresh" onRelease="refreshIncidents">
            <TableView id="incidentTable" backgroundColor="transparent"/>
        </Widget>
    </View>
</Alloy>
ruscles commented 9 years ago

This is only on iOS, neither issue occurs on Android

FokkeZB commented 9 years ago

A TableView inside a ScrollView is discouraged. Why would you do that? All that the iOS (latest) version does is enabling http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.ListView-property-refreshControl. Do you see the same issue when you do that without the widget?

ruscles commented 9 years ago

In order to have the refresh trigger on release (seen below) I have to have the TableView inside the ScrollView. The problem is the widget disappears when I open a window from this view and then return to the view with the widget. ios simulator screen shot sep 8 2015 8 49 18 am

If I have just the TableView, the refresh is triggered as soon as the table is pulled down any distance - not when I pull and release the table. (seen below) ios simulator screen shot sep 8 2015 8 47 17 am

FokkeZB commented 9 years ago

You really shouldn't need to wrap it in a ScrollView. It will only make things worse :)

Again, the refreshControl is simply that of Apple, out of the box - no changes. So if you can make a test case (preferably in classic, without the widget) reproducing that what you see (make a video) is not expected behaviour, please create a ticket at jira.appcelerator.org to report it as a bug.