lucaspulliese / vue-cool-lightbox

Vue.js lightbox inspired by fancybox.
https://vue-cool-lightbox.lucaspulliese.com
340 stars 55 forks source link

Clicking background doesn't close light box from version 2.7.3 #105

Open iamlili opened 2 years ago

iamlili commented 2 years ago

Hi

Noticed a weird behaviour in 2.7.3 and 2.7.4

Clicking on the background doesn't close it (except sometimes, if there happens to be a link under the lightbox directly where you are clicking)

Works as expected in 2.7.2.

xelaris commented 2 years ago

Hey, I can confirm this issue. We are experiencing this in case of having a (single) video shown in the lightbox and only when clicking on the left or right side. Clicking the top or bottom part of the background, closes the modal.

The issue is caused by the following change: https://github.com/lucaspulliese/vue-cool-lightbox/commit/73eab5dd34d97532ebc101e49fa8ff901f900718#diff-f07caa2d9df351447131dd468f3e01655aa6327c0583c83812feae20a16d004dR1519

In case of a video, .cool-lightbox__iframe stretches across the whole viewport, so a click on it should still close the modal. Maybe the change can be just reverted, but probably there was a reason it. /cc @lucaspulliese

vue-cool-lightbox-video

(The documentation website uses an older version, so the issue can't be reproduced there)