Skip to content

Instantly share code, notes, and snippets.

@orb orb/example.js
Last active Apr 6, 2017

Embed
What would you like to do?
bootrap modal hide event
// capturing the hide event instead of the hidden event lets us intercept the close and update our state
//
componentDidMount = () => {
$(this.node).on("hide.bs.modal",
(e) => {
if (this.props.open) {
// if we say the modal should be open but it want's to close
e.preventDefault(); // stop it from closing
this.props.closeMe(); // update our state to request our close, if we want that behavior
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.