rn-bottom-drawer icon indicating copy to clipboard operation
rn-bottom-drawer copied to clipboard

how to disable swipe down?

Open ramadhanoo opened this issue 5 years ago • 2 comments

ramadhanoo avatar May 15 '19 11:05 ramadhanoo

Probably a bit late, but here is a quick fix:

Inside BottomDrawer.js I added an extra property swipeDown which has a default value of true. I then added a check in Animator.js inside handlePanResponderMove:

_handlePanResponderMove = (e, gesture) => { if (this._swipeInBounds(gesture)) { if(this.props.swipeDown) this.position.setValue({ y: this.props.currentPosition.y + gesture.dy }); } else { this.position.setValue({ y: this.props.upPosition.y - this._calculateEase(gesture) }); } }

Now I can set the swipeDown property to true or false in the BottomDrawer component. When the drawer is in its down position it can't move down only up.

larsyuipo avatar Jan 04 '20 18:01 larsyuipo

Thanks for this, I suspect it might fix the issue I logged

Quentinb avatar Sep 20 '21 06:09 Quentinb