我目前正在使用react-modal包裹。
我想禁用 react 模式组件外部的点击和滚动。
最佳答案
将此行添加到模态组件中
<ReactModal
//other props declaration..
shouldCloseOnOverlayClick={false} // add this to prevent outside click to prevent modal close
>
或使用event.preventDefault()
来修复它
关于javascript - 如何防止在React Modal之外点击?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47175599/