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

"Copy Image" to clipboard no working in Chrome/Edge. (But correct in IE). #675

Open
scottieGGGG opened this issue Nov 14, 2019 · 1 comment

Comments

@scottieGGGG
Copy link

What version of Lightbox2 you are using?
Found while using v 2.10.0, but confirmed on package's website using latest.

Which browsers and operating systems have you seen the issue on?
Windows 10
Chrome 78.0.3904.97
Edge Beta Version 79.0.309.18 (Official build) beta (64-bit)

Note: The bug is NOT reproducible with IE 11 (v11.775.17763.0)

What are the steps to reproduce the bug?
From Chrome / Edge:

  • Navigate to https://lokeshdhakar.com/projects/lightbox2/
  • Click on either of the two "Example Two Individual Images" to open preview gallery / lightbox
  • Right click image and select "Copy Image"
  • Switch to any destination application you wish to paste (ie. Microsoft Paint, MS Word)
  • When attempting to paste, it's discovered the image is not in the clipboard.
    (On Windows, can be confirmed via monitoring with clipboard tool via Windows Key + V)

Do you have link to a live site where the bug is visible? or can you post relevant HTML, CSS, and Javascript?
Visible on package's demo page (https://lokeshdhakar.com/projects/lightbox2/)

@scottieGGGG
Copy link
Author

scottieGGGG commented Nov 14, 2019

There is a comment block within the .js file that indicates a work around is (was?) working for this issue, but perhaps that work around is no longer working?

From lightbox.js

  Show context menu for image on right-click

  There is a div containing the navigation that spans the entire image and lives above of it. If
  you right-click, you are right clicking this div and not the image. This prevents users from
  saving the image or using other context menu actions with the image.

  To fix this, when we detect the right mouse button is pressed down, but not yet clicked, we
  set pointer-events to none on the nav div. This is so that the upcoming right-click event on
  the next mouseup will bubble down to the image. Once the right-click/contextmenu event occurs
  we set the pointer events back to auto for the nav div so it can capture hover and left-click
  events as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants