Commit e04e2c62 authored by 李勇諭's avatar 李勇諭

support safari

parent cb5da6c6
......@@ -24,8 +24,8 @@ export class Basic extends React.Component<BasicProps, BasicState> {
pullDownThreshold={200}
onRefresh={this.onRefresh}
>
<div style={{height: "95vh", textAlign: "center"}}>
<div onClick={console.log}>PullToRefresh</div>
<div style={{height: "150vh", textAlign: "center"}}>
<div>PullToRefresh</div>
</div>
</PullToRefresh>
</div>
......
......@@ -80,6 +80,7 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
this.dragging = true;
this.container.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)";
this.pullDown.style.transition = "transform 0.2s cubic-bezier(0,0,0.31,1)";
e.preventDefault();
}
@autobind
......@@ -93,6 +94,8 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
return;
}
e.preventDefault();
if ((this.currentY - this.startY) >= this.props.pullDownThreshold) {
this.setState({
pullToRefreshThresholdBreached: true,
......@@ -135,6 +138,11 @@ export class PullToRefresh extends React.Component<PullToRefreshProps, PullToRef
});
}
@autobind
private stopScroll(e) {
e.preventDefault();
}
private initContainer() {
requestAnimationFrame(() => {
this.container.style.overflow = "auto";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment