lightGallery icon indicating copy to clipboard operation
lightGallery copied to clipboard

Issue when double clicking on an image to zoom in

Open addison74 opened this issue 3 years ago • 5 comments

I am using a desktop monitor (1920 x 1080 px) and Google Chrome 97.0.4692.99 (64-bit) as browser. Here are the steps to reproduce this issue:

  1. Maximize your browser window and visit this link https://www.lightgalleryjs.com/demos/thumbnails/

  2. Open the first demo (Animated thumbnails). Click on a thumbnail at the bottom then double click on the image for zooming in. The image will zoom but it is not centered in the middle of the screen. Double click to zoom out. Click again on thumbnail and double click, in my case the image zooms in in a different position.

Please note if I use the zoom icon from top right the image fits as expected both sides.

It is obvious that it is easier to double click the image than to go up for each of them to press the zoom icon. Those who double click will get annoyed (my case) when they find that the images are not centered in relation to the edges of the screen, with random positions. You should add the action from the zoom icon to double click too.

Here are two screenshots and see the width of the sides

screenshot

screenshot-2

addison74 avatar Jan 27 '22 17:01 addison74

Better analyzing the issue in the case of very large images in size, when double click is executed, the position of the mouse pointer counts because that area will be focus. Just double click more to the left and more to the right and see how the image moves to both sides. For this reason the black left-right background does not have the same width. If the image gets bigger it could overlap the black background and then it wouldn't be an issue. That depends on the zoom value.

addison74 avatar Jan 27 '22 19:01 addison74

Hey @ADDISON74,

Thank you for the suggestion. But this is intentionally implemented this way after so much user feedback and iteration.

When someone double click/tap on the photo to zoom in, they usually want the photo to be zoomed in from the clicked position. lightGallery always tries to keep the clicked portion as close as possible to the mouse pointer.

But, I got your point, and I'll keep this issue open for some time. If we get more positive feedback, we can incorporate your suggestion

sachinchoolur avatar Jan 28 '22 12:01 sachinchoolur

As you stated it is not a code error but a feature request. It could be solved with a new option, for example even if I double-click in a certain area to enlarge the image from the center. There may also be an option for the zoom level to overlap the black side edges.

Thank you for your work. I'm evaluating lightGallery for the first time to replace Photoswipe. So far I think I've found what I was looking for.

addison74 avatar Jan 28 '22 12:01 addison74

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 29 '22 14:03 stale[bot]

This will be available in the next version. With an option to disable it

sachinchoolur avatar Jun 20 '22 14:06 sachinchoolur

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 31 '22 00:08 stale[bot]