mirror of https://gitee.com/answerdev/answer.git
fix(ImgViewer): Make `ImgViewer` clickable to close the image
This commit is contained in:
parent
ddda7e6d5a
commit
f89687d021
|
@ -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}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Reference in New Issue