octopitus / rn-sliding-up-panel

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

Implement onTopReached #151

Open nikoloz110 opened 4 years ago

nikoloz110 commented 4 years ago

Issue Description

Can we implement function onTopReached to call when the top is reached? just like it is with onBottomReached

ItoestePm commented 4 years ago

Hi, maybe this helps you.

use the onDragEnd or onDragStart events as needed

onDragStart={(value)=>{ alert(value) }}

onDragEnd={(value)=>{ alert(value) }}

this returns the position where the drag ends or start.

Regards :)

effy-coding commented 4 years ago

@ItoestePm is it possible to detect top reached? onDragEnd callback just triggers when user stopped dragging. It doesn't mean panel reached top.

ValentinH commented 4 years ago

I would even suggest to implement an onSnapPointReached() that would be triggered for bottom, top and each snap point. What do you think?