m-pull-to-refresh
m-pull-to-refresh copied to clipboard
must set height and overflow ?
eg:
<Pull2Refresh
style={{ height: 'calc(100vh - 176px)', overflow: 'auto' }}
refreshing={loading}
onRefresh={this.refresh}
indicator={{ release: <Loading loading /> }}
>
<PatientList list={handleList} />
</Pull2Refresh>
if you don't set, the scroll will always trigger refresh, even you want to look more, i think this is bug;
i meet the same problem. the height must be setted, otherwise the scroll will always trigger refresh whenever you touch move
i add some code in the onTouchMove function to adapt when the height is not setted.
const clientHeight = window.screen.height || document.documentElement.clientHeight;
let elePageY;
const { direction } = this.props;
if (direction === UP) {
elePageY = ele.offsetTop + ele.getBoundingClientRect().height;
} else {
elePageY = ele.offsetTop;
}
if (Math.abs(this._pageY - elePageY) > clientHeight * 0.6) {
return
}
我也有这个问题 Moreover, if I set height to '100%' it only works if the height of the parent component is not set to a fixed height. Which I don't want to...