Topic: Modal with backdrop disappears unexpectedly
Expected behavior
Modal should not be closed if the click is initiated on the modal and then mouse pointer goes away from modal and the click ended on the backdrop
Actual behavior
The modal is being closed if mousedown has occurred on the modal and mouseUp has occurred on the backdrop
Resources (screenshots, code snippets etc.)
video: http://somup.com/cq1qQ0nLmI
I would kindly ask you to consider the folowing solution:to change onClick into onMouseDown in you code. The fragment is bellow.
Modal.js // Line 148
<Transition
timeout={timeout}
in={this.state.isOpen}
appear={this.state.isOpen}
mountOnEnter
unmountOnExit
onClick={this.handleBackdropClick} // <---------------
onEntered={node => this.handleOnEntered('modal', node)}
onExit={node => this.handleOnExit('modal', node)}
>
Aliaksandr Andrasiuk staff answered 6 years ago
Hi,
Thank you for the founded bug and a provided video. We will fix it in the near future.
Best regards.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Free
- Premium support: No
- Technology: MDB React
- MDB Version: 4.16.0
- Device: PC
- Browser: Chrome 75.0.3770.100
- OS: Windows 7 64
- Provided sample code: No
- Provided link: Yes