dimsemenov / Magnific-Popup

Light and responsive lightbox script with focus on performance.
http://dimsemenov.com/plugins/magnific-popup/
MIT License
11.39k stars 3.48k forks source link

Second picture in Gallery is skipped #1091

Open oehiroaki opened 6 years ago

oehiroaki commented 6 years ago

Hi, there is an obvious bug with the Lightbox Gallery mode, which was found not only in my sample website but also in the official website. http://dimsemenov.com/plugins/magnific-popup/

When you click any of the thumbnails in the Gallery and while you do not move your cursor yet and the cursor is sort of 'grabbing' the thumbnail, hit the right arrow key of your keyboard. Then, the next picture is always skipped and the third picture comes up. From this point, once your cursor is freed from the thumbnail, arrow keys work appropriately and no picture is skipped.

This does not occur if you hit arrow keys after you move your cursor away from the thumbnail you click.

It seems that if the cursor is freed up from the thumnaile immediately after you click it, this problem will be solved. Unfortunately I am not a Javascript specialist and don't know how to do it.

I'd appreciate it if somebody could fix this as soon as possible.

oehiroaki commented 6 years ago

There is a similar open issue form long time ago: #158. https://github.com/dimsemenov/Magnific-Popup/issues/158

oehiroaki commented 6 years ago

I was able to surpress this problem by removing "title" from the thumbnail. When I say the cursor is "grabbing" the thumbnail, it was the situation that a picture title of the thumbnail is shown underneath the cursor.

Here is my code. I removed the title from this.

a href="xyz" title="Photo 1"