I have 6 buttons that, when pressed, activate the modal. It is written in React.
//Since I have 6 different modals, giving each of them an id would distinguish them onCloseModal(id) { this.setState({ open: false, modalShown: id }) } render() { return ( <Modal onHide={this.onCloseModal.bind(this, item.id)} keyboard={true}> <Modal.Header closeButton={true} onHide={this.onCloseModal.bind(this)}> </Modal.Header> </Modal> ) }
I have keyboard={true} , which according to the documentation in https://react-bootstrap.imtqy.com/components.html#modals-props pressing Escape will exit the modal. However, it does not work. I believe that everything is configured for me, because each of my buttons has a unique identifier - why does the escape key not respond?
Here is a modal in action.

source share