Closed DaniAkash closed 4 years ago
The word close
may not the right term if the draggableRange has bottom value higher 0. close
is when something is going to be dismissed or gone (E.g Close modal, close drawer, close database connection...).
If you want is to be notified when the panel reaches the bottom, you can use onMomentumDragEnd
or InteractionManager:
_handleOnMomentumEnd(value) {
// Compare the value with the bottom of draggableRange
if (value === 0) {
}
}
// This method is called when you click a button to hide the panel
_hidePanel() {
this._panel.hide()
InteractionManager.runAfterInteractions(() => {
// ...long-running synchronous task...
});
}
<Panel
ref={c => this._panel = c}
onMomentumDragEnd={this._handleOnMomentumDragEnd}
/>
Still i'd like to have a single handler to handle this. Will onHide
be the right term?
How about onBottomReached
?
Sure it will work. I'll update my PR
Sure it will work. I'll update my PR
Any plans to update this PR?
Any chance we can get this PR merged? I'd love to use the onClose functionality!
This PR seems like exactly what I need, but I see two issues with it:
README.md
index.d.ts
) have not been updated to include the new prop.@jaredegan i'll update the PR. Its been a long time
Thanks, Dani! I know how these things go, hopefully we can get it merged in.
@jaredegan I have updated the PR
Published in v2.4.0
Excellent! 🤘
@octopitus looks like 2.4.0 was not successfully published: https://www.npmjs.com/package/rn-sliding-up-panel
@jaredegan Opps I published using wrong registry config 🤦♂
// Edit: Updated.
Will add an onClose prop which will be called every time the panel is closed.