fix(ImgViewer): Enables Modal to be closed even when `Modal.Body` is clicked

This commit is contained in:
haitaoo 2023-02-27 15:13:00 +08:00
parent 0566894a2c
commit 2cb0468605
1 changed files with 1 additions and 3 deletions

View File

@ -55,13 +55,11 @@ const useImgViewer = () => {
scrollable
contentClassName="bg-transparent"
onHide={onClose}>
<Modal.Body>
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */}
<Modal.Body onClick={onClose}>
<img
className="cursor-zoom-out img-fluid position-absolute top-50 start-50 translate-middle"
src={imgSrc}
alt={imgSrc}
onClick={onClose}
/>
</Modal.Body>
</Modal>,