PullDownToRefresh: fix wheeling switch page
This commit is contained in:
		
							parent
							
								
									15e2bf3304
								
							
						
					
					
						commit
						c8f2179298
					
				
					 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…
	
	Add table
		Add a link
		
	
		Reference in a new issue