m-pull-to-refresh icon indicating copy to clipboard operation
m-pull-to-refresh copied to clipboard

must set height and overflow ?

Open OPY-bbt opened this issue 6 years ago • 3 comments

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;

OPY-bbt avatar Mar 20 '18 09:03 OPY-bbt

i meet the same problem. the height must be setted, otherwise the scroll will always trigger refresh whenever you touch move

zhengcanbiao avatar Sep 19 '18 09:09 zhengcanbiao

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
}

zhengcanbiao avatar Sep 20 '18 11:09 zhengcanbiao

我也有这个问题 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...

cvolant avatar Apr 24 '20 12:04 cvolant