octopitus / rn-sliding-up-panel

Draggable sliding up panel implemented in React Native https://octopitus.github.io/rn-sliding-up-panel/
MIT License
925 stars 157 forks source link

FlatList and SlidingUpPanel #189

Open xfishernet opened 3 years ago

xfishernet commented 3 years ago

Hi guys! Horizontal FlatList not worked (conflict vertical and horizontal scrolling?) inside SlidingUpPanel! Can i set draggable area, only top part of SlidingUpPanel?

kathawala commented 3 years ago

@xfishernet

The same swipe gesture is handled by both SlidingUpPanel and FlatList/ScrollView. You need to determine when the gesture should be handled by which component. I'd recommend you set allowDragging to false in the SlidingUpPanel when you want the user to scroll the flatlist horizontally and set scrollEnabled to false in the FlatList/ScrollView when you want the user to drag the panel up or down.

You can use gestureState.vx and gestureState.vy of the onDragStart callback to determine the direction of the user's swipe gesture and use that to decide whether to allow dragging or scrolling in your component. Best of luck!