Fix toggle show control firing unnecessarily

This commit is contained in:
Lim Chee Aun 2023-10-29 10:14:35 +08:00
parent 173728536a
commit 25ff0d7835

View file

@ -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);
}
}}