Open scousino opened 3 years ago
The cancel button fires close()
which calls this.props.onModalClose(item)
. That always fires when the cancel button is pressed.
https://github.com/peacechen/react-native-modal-selector/blob/master/index.js#L193
If you're creating the button yourself, you have complete control over its callback. I might not be understanding your question fully. Please submit a PR if a change is required in this library.
Yes if you look at that exact method you referred to, the close()
method sets the visibility of the modal explicitly. However, I'm trying to control the visibility of the Modal manually like the doc indicates. But this explicit setting of the visibility by the package while I'm trying to rightfully be in full control of visibility breaks that functionality/understanding.
Add a prop that accepts a callback that will execute when the user presses the cancel button.
Right now, I'm manually controlling the visibility of the ModalSelector, but I have no way to when the user has selected cancel other than onModalClose, but I can't use that because I'm manually controlling the visibility.