nuclearpasta / react-native-drax

A drag-and-drop system for React Native
MIT License
554 stars 68 forks source link

Should DraxView longPressDelay default to 0? #11

Closed lafiosca closed 4 years ago

lafiosca commented 4 years ago

Currently, there's a default longPressDelay of 250ms on DraxView: https://github.com/nuclearpasta/react-native-drax/blob/d865764714d08dd45c504477aaeb8f3098f96562/src/params.ts#L8

Why? I mean, I know why as the author: the initial use case was to implement a drag-reorderable list, which meant that I needed the delay to prevent the drags from capturing list scroll gestures. But for the standard DraxView use case, might we not want to default to 0, which allows instant grabbing of the view to drag?

One possible counterpoint would be when the draggable views may have standard Touchable buttons embedded in them. The longPressDelay prevents the drag from hijacking those touches. But it can be lowered a little bit for that case as well. The 250ms value came from what "felt right" for reorderable lists.

lafiosca commented 4 years ago

Let's change the DraxView default delay to 0 but leave it at 250 for items in a DraxList.