Skip to content
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

Issue when lightbox is closed during animation #200

Open
mikwebdev opened this issue Oct 26, 2020 · 6 comments
Open

Issue when lightbox is closed during animation #200

mikwebdev opened this issue Oct 26, 2020 · 6 comments
Assignees
Labels
bug input needed more information

Comments

@mikwebdev
Copy link

Reproducible: Always

Steps to Reproduce:

  1. Click on image to open gallery
  2. Close lightbox during animation (fade) by using Esc key or clicking outside of image

Actual Results:
Simplelightbox has stopped working.

Expected Results:
The gallery is closed and can be opened again.

@andreknieriem
Copy link
Owner

I can reproduce this. Thanks. Will take a look how to fix this ;)

@andreknieriem andreknieriem self-assigned this Oct 29, 2020
andreknieriem pushed a commit that referenced this issue Oct 29, 2020
@mikwebdev
Copy link
Author

Thank you!
It no longer stops working with error when changing image (next/previous) in the gallery and during the animation (fade) when you close (Esc or click outside of image) the gallery, that is fixed! 👍

But, I'm not sure it fully fixed. When closing during the opening of the gallery, it still stops working with an error. While clicking an image to open gallery, when the image fading in and you close the gallery with Esc or clicking outside, that still doesn't work correctly, SimpleLightbox stops working and Web console shows an error. Maybe that's an edge case, if you could take a look again, I would be grateful.

@andreknieriem andreknieriem reopened this Oct 31, 2020
@andreknieriem
Copy link
Owner

Hey, I can't reproduce. Which browser are you using?

@andreknieriem andreknieriem added the input needed more information label Nov 2, 2020
@mikwebdev
Copy link
Author

Hey, I can't reproduce. Which browser are you using?

Firefox 82.0.2.
Try hitting Esc while the fadeIn animation runs when opening the gallery, SimpleLightbox stops working.

@andreknieriem
Copy link
Owner

You are right and it only occurs in firefox :( I will take a look.

@SpicerSolutions
Copy link

This may or may not be related.

I've created the following code

        $('#test').simpleLightbox({
            nav: false,
            swipeClose: false,
            showCounter: false,
            loop: false,
            history: false,
            disableScroll: true,
            spinner: false,
            fadeSpeed: 100
        });

        $('.btn-open').click(function(e){
            $('#test').simpleLightbox().open();
        });

If you alternate between clicking on the a tag and click on the button the lightbox elements are left behind (see below) (over the click regions) and you are left unable to open the lightbox. The more often you click the more lightbox element appears as if they're being initialised more than once.

×
Boat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug input needed more information
Projects
None yet
Development

No branches or pull requests

3 participants