You can manually call to transactionTo inside onDragEnd event (It's invoked with the current position of the panel) with some conditions e.g. did user scroll over half of draggable range? If yes, then scroll to top, otherwise scroll back to bottom.
_handleOnDragEnd(position) {
if (position > 640/2) {
this._panel.transitionTo(640)
} else {
this._panel.transitionTo(0)
}
}
<SlidingUpPanel
ref={c => this._panel = c}
draggableRange={{top: 640, bottom: 0}}
onDragEnd={this._handleOnDragEnd}
/>
_Originally posted by @octopitus in https://github.com/octopitus/rn-sliding-up-panel/issues/39#issuecomment-374865105_```
This code is not working anymore. What's the replacement for this code?
You can manually call to
transactionTo
insideonDragEnd
event (It's invoked with the current position of the panel) with some conditions e.g. did user scroll over half of draggable range? If yes, then scroll to top, otherwise scroll back to bottom.