PullDownToRefresh:fix wont pull back when touchend
This commit is contained in:
		
							parent
							
								
									2d7b931ef8
								
							
						
					
					
						commit
						0d856c61c7
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -103,7 +103,7 @@ const PullDownToRefresh: Component<{
 | 
			
		|||
  const handleTouch = (event: TouchEvent) => {
 | 
			
		||||
    if (event.targetTouches.length > 1) {
 | 
			
		||||
      lastTouchId = 0;
 | 
			
		||||
      lastTouchScreenY;
 | 
			
		||||
      lastTouchScreenY = 0;
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    const item = event.targetTouches.item(0)!;
 | 
			
		||||
| 
						 | 
				
			
			@ -128,7 +128,12 @@ const PullDownToRefresh: Component<{
 | 
			
		|||
    lastTouchScreenY = 0;
 | 
			
		||||
    holding = false;
 | 
			
		||||
    if (untrack(pullDownDistance) >= 160 && !props.loading && props.onRefresh) {
 | 
			
		||||
      setTimeout(props.onRefresh, 0)
 | 
			
		||||
      setTimeout(props.onRefresh, 0);
 | 
			
		||||
    } else {
 | 
			
		||||
      if (released) {
 | 
			
		||||
        released = false;
 | 
			
		||||
        requestAnimationFrame(updatePullDown);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue