From 25ff0d7835bab3e059b91e37b5dae2ced4b10d5e Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sun, 29 Oct 2023 10:14:35 +0800 Subject: [PATCH] Fix toggle show control firing unnecessarily --- src/components/media-modal.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/media-modal.jsx b/src/components/media-modal.jsx index 3c920cc2..72b6cebc 100644 --- a/src/components/media-modal.jsx +++ b/src/components/media-modal.jsx @@ -142,7 +142,11 @@ function MediaModal({ key={media.id} ref={i === currentIndex ? carouselFocusItem : null} onClick={(e) => { - if (e.target !== e.currentTarget) { + // console.log(e); + // if (e.target !== e.currentTarget) { + // setShowControls(!showControls); + // } + if (!e.target.classList.contains('media')) { setShowControls(!showControls); } }}