Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

fix(ImgViewer): Correctly set the centre alignment and top alignment of images

haitaoo682ca72324e8
diff --git a/ui/src/hooks/useImgViewer/index.tsx b/ui/src/hooks/useImgViewer/index.tsx
index 6fa94b17..6b3a30c2 100644
--- a/ui/src/hooks/useImgViewer/index.tsx
+++ b/ui/src/hooks/useImgViewer/index.tsx
@@ -56,9 +56,9 @@ const useImgViewer = () => {
scrollable
contentClassName="bg-transparent"
onHide={onClose}>
- <Modal.Body onClick={onClose}>
+ <Modal.Body onClick={onClose} className="p-0 d-flex">
<img
- className="cursor-zoom-out img-fluid position-absolute top-50 start-50 translate-middle"
+ className="cursor-zoom-out img-fluid m-auto"
src={imgSrc}
alt={imgSrc}
/>