PullDownToRefresh: fix wheeling switch page
This commit is contained in:
parent
bcfb846115
commit
d44a90ab49
1 changed files with 2 additions and 2 deletions
|
@ -95,7 +95,7 @@ const PullDownToRefresh: Component<{
|
|||
const scrollTop = (event.target as HTMLElement).scrollTop;
|
||||
if (scrollTop >= 0 && scrollTop < 1) {
|
||||
const d = untrack(pullDown);
|
||||
if (event.deltaY <= 0 || d > 0) event.preventDefault();
|
||||
if (d > 1) event.preventDefault();
|
||||
ds = -(event.deltaY / window.devicePixelRatio / 2);
|
||||
holding = d < stopPos();
|
||||
if (wheelTimeout) {
|
||||
|
@ -129,7 +129,6 @@ const PullDownToRefresh: Component<{
|
|||
return;
|
||||
}
|
||||
const item = event.targetTouches.item(0)!;
|
||||
if (untrack(pullDown) > 0) event.preventDefault();
|
||||
if (lastTouchId && item.identifier !== lastTouchId) {
|
||||
lastTouchId = undefined;
|
||||
lastTouchScreenY = 0;
|
||||
|
@ -140,6 +139,7 @@ const PullDownToRefresh: Component<{
|
|||
if (lastTouchScreenY !== 0) {
|
||||
ds = item.screenY - lastTouchScreenY;
|
||||
}
|
||||
if (Math.abs(ds) > 1 && untrack(pullDown) > 1) event.preventDefault();
|
||||
lastTouchScreenY = item.screenY;
|
||||
if (released) {
|
||||
released = false;
|
||||
|
|
Loading…
Reference in a new issue