File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed 
package/src/components/Message/MessageSimple Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ export const SwipableMessageBubble = React.memo(
101101    ) ; 
102102
103103    const  SWIPABLE_THRESHOLD  =  25 ; 
104+     const  MINIMUM_DISTANCE  =  8 ; 
104105
105106    const  triggerHaptic  =  NativeHandlers . triggerHaptic ; 
106107
@@ -120,14 +121,17 @@ export const SwipableMessageBubble = React.memo(
120121            const  xDiff  =  Math . abs ( event . changedTouches [ 0 ] . x  -  touchStart . value . x ) ; 
121122            const  yDiff  =  Math . abs ( event . changedTouches [ 0 ] . y  -  touchStart . value . y ) ; 
122123            const  isHorizontalPanning  =  xDiff  >  yDiff ; 
124+             const  hasMinimumDistance  =  xDiff  >  MINIMUM_DISTANCE  ||  yDiff  >  MINIMUM_DISTANCE ; 
123125
124-             if  ( isHorizontalPanning )  { 
126+             // Only activate if there's significant horizontal movement 
127+             if  ( isHorizontalPanning  &&  hasMinimumDistance )  { 
125128              state . activate ( ) ; 
126129              isSwiping . value  =  true ; 
127130              if  ( ! shouldRenderSwipeableWrapper )  { 
128131                runOnJS ( setShouldRenderAnimatedWrapper ) ( isSwiping . value ) ; 
129132              } 
130-             }  else  { 
133+             }  else  if  ( hasMinimumDistance )  { 
134+               // If there's significant movement but not horizontal, fail the gesture 
131135              state . fail ( ) ; 
132136            } 
133137          } ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments