rn-bottom-drawer
rn-bottom-drawer copied to clipboard
how to disable swipe down?
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.
Thanks for this, I suspect it might fix the issue I logged