chore: update dialog event listener

This commit is contained in:
Steven
2022-08-30 07:41:28 +08:00
parent e7b287902b
commit 2a11aed881
4 changed files with 23 additions and 4 deletions

View File

@ -19,6 +19,10 @@ const PreviewImageDialog: React.FC<Props> = ({ destroy, imgUrl }: Props) => {
a.click();
};
const handleImgContainerClick = () => {
destroy();
};
return (
<>
<div className="btns-container">
@ -29,8 +33,8 @@ const PreviewImageDialog: React.FC<Props> = ({ destroy, imgUrl }: Props) => {
<Icon.Download className="icon-img" />
</button>
</div>
<div className="img-container">
<img src={imgUrl} />
<div className="img-container" onClick={handleImgContainerClick}>
<img onClick={(e) => e.stopPropagation()} src={imgUrl} />
</div>
</>
);