react-native-bottom-sheet icon indicating copy to clipboard operation
react-native-bottom-sheet copied to clipboard

onDrag, onDragBegin, onDragEnd callbacks to know when drawer is being dragged/pulled

Open jacenko opened this issue 4 years ago • 32 comments

Feature Request

(Going from #351 by @midasCE and adding some details) We could have a callback for when the user starts/continues/finishes dragging the handler? (Example: onDrag, onDragBegin, onDragEnd which return start/end index)

Why it is needed

Currently, bottomsheet has only two position-based callbacks - onChange and onAnimate - which are only triggered once the user releases their finger. If we could detect when a user is pressing and dragging the drawer (just like onScroll, onScrollBegin, onScrollEnd in scrollables), we'd be able to more closely replicate advanced bottom sheet behavior like other components reacting/animating to the drawer dragged height (note the Google logo and search bar in this video).

Possible implementation

Updates would live alongside onAnimate and onClose in:

Code sample

const onDrag = (fromIndex: number, (maybe other params to determine position) => {
   ......
}
...
onDragHandler={onDrag}

jacenko avatar Oct 13 '22 16:10 jacenko

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Nov 13 '22 09:11 github-actions[bot]

Not stale

jacenko avatar Nov 13 '22 15:11 jacenko

Very interested in this feature request 👍

jeremyallison avatar Nov 22 '22 14:11 jeremyallison

up

ehsanbigzad avatar Dec 08 '22 06:12 ehsanbigzad

interested as well

margabit avatar Dec 10 '22 08:12 margabit

please add this feature

branaust avatar Dec 13 '22 05:12 branaust

this feature would be very useful

Marco-Veio avatar Jan 11 '23 18:01 Marco-Veio

please add this feature.

atiq4112 avatar Feb 01 '23 03:02 atiq4112

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Mar 03 '23 09:03 github-actions[bot]

is there any progress on maybe adding this?

kneza23 avatar Mar 03 '23 10:03 kneza23

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 03 '23 09:04 github-actions[bot]

Not stale

kneza23 avatar Apr 03 '23 09:04 kneza23

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 04 '23 09:05 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar May 10 '23 09:05 github-actions[bot]

Would love to see this feature. Mainly for a way to may the pull to refresh work in the lowest position

slangdog avatar Jun 14 '23 11:06 slangdog

Would love to see this feature. Mainly for a way to may the pull to refresh work in the lowest position

It would be amazing if you could observe the onDrag values so you can animate some other outside components when you are dragging.

kneza23 avatar Jun 14 '23 12:06 kneza23

Not stale, need this

slutske22 avatar Jul 21 '23 20:07 slutske22

Any reason this is closed?

NicholasBoccuzzi avatar Jul 24 '23 03:07 NicholasBoccuzzi

It would be a great addition.

ArkaneKhan avatar Jul 27 '23 14:07 ArkaneKhan

Also need this

IordanisSap avatar Jul 27 '23 16:07 IordanisSap