-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lightbox closes when image clicked when backdropClosesModal = true #152
Comments
I tested this and overrriding of onClickImage doesn't seem to actually happen however the image is indeed closing when backdropClosesModal is set to true and you click on the image. Adding |
|
let me know if that looks ok. this also resolved #155. seemed liked the cleanest/safest way to only target the backdrop click. |
I haven't tested but the logic seems correct to me. Personally, the route I'd take would be to have a default prop for the Anyway, whatever works, works. 👍 |
@benhowell That wouldnt solve #155 or any other items the user might click on that is within the container that should not close the lightbox. it's not just an onClickImage problem. |
Steps to reproduce the behavior:
Set
backdropClosesModal = true
Click on image in lightbox.
Expected behavior:
Lightbox shouldn't close.
Actual behavior:
Lightbox closes.
Further info
It appears that
backdropClosesModal
overridesonImageClick
. Further, supplying a customonImageClick
function withevent.preventDefault()
andevent.stopPropagation()
allowsonClickImage
to function properly but disablesbackdropClosesModal
.This issue has been indirectly reported previously here: #135
The text was updated successfully, but these errors were encountered: