react-native-ptr-control icon indicating copy to clipboard operation
react-native-ptr-control copied to clipboard

onHeaderRefreshing fired on load

Open Ahagan opened this issue 6 years ago • 3 comments

On android, the onHeaderRefreshing event is fired when the component is first mounted. On iOS it does not.

I expect that it should only fire on android once the screen is pulled down.

Example usage

 <PTRControl
                style={{ flex: 1 }}
                enableHeaderRefresh={true}
                getRef={ref => this.refOfScrollList = ref}
                showsVerticalScrollIndicator={false}
                onTopReachedThreshold={10}
                onEndReachedThreshold={10}
                scrollEnabled={true}
                setHeaderHeight={60}
                scrollComponent={'ScrollView'}
                enableFooterInfinite={true}
                onHeaderRefreshing={() => { // Executed }}
                onFooterInfiniting={() => {}}
            >
.... Content
</PTRControl>

Ahagan avatar Oct 03 '18 20:10 Ahagan

@Ahagan all right , at first, i also want to prevent the case what you mentioned, but i found that it is the best solution that work well on android, in order to guaranteed the performance on android, you know, gesture in ScrollView will be interrupt by ScrollView, so this pull-to-refresh header is hidden in ScrollView, that is why on android onHeaderRefreshing will be fired on load. anyway, PR is appreciated

woowalker avatar Oct 09 '18 03:10 woowalker

How can we close this situation?

renjinlong avatar Nov 20 '18 09:11 renjinlong

is anyone solved this problem?

MasIzzudin avatar Aug 14 '19 02:08 MasIzzudin