fix(ImgViewer): Make `ImgViewer` clickable to close the image

This commit is contained in:
haitaoo 2023-04-25 15:09:02 +08:00
parent ddda7e6d5a
commit f89687d021
1 changed files with 5 additions and 0 deletions

View File

@ -66,8 +66,13 @@ const Index: FC<{
contentClassName="bg-transparent" contentClassName="bg-transparent"
onHide={onClose}> onHide={onClose}>
<Modal.Body onClick={onClose} className="img-viewer p-0 d-flex"> <Modal.Body onClick={onClose} className="img-viewer p-0 d-flex">
{/* eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-noninteractive-element-interactions */}
<img <img
className="cursor-zoom-out img-fluid m-auto" className="cursor-zoom-out img-fluid m-auto"
onClick={(evt) => {
evt.stopPropagation();
onClose();
}}
src={imgSrc} src={imgSrc}
alt={imgSrc} alt={imgSrc}
/> />