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

Is it possible to close upon clicking the gray area outside of the image viewer box? #10

Open
vaultec81 opened this issue Aug 31, 2021 · 4 comments

Comments

@vaultec81
Copy link

Is it possible to close upon clicking the gray area outside of the image viewer box? I think this is specific enough, similar to other image previewers like the one on discord for example.

@specter256
Copy link
Owner

Please, try release 1.1.0 - new prop closeOnClickOutside was added.

@vaultec81
Copy link
Author

vaultec81 commented Aug 31, 2021

Please, try release 1.1.0 - new prop closeOnClickOutside was added.

Great I am glad to see this being implemented.

One issue is it only works for part of the screen and not the full size of the screen
image
image

Only the area on the left and right of the image will close the preview. The top and bottom will not trigger closing. I don't know if this is intention or a bug, but either way would be great to have such functionality.

@specter256
Copy link
Owner

What browser are you using? When closeOnClickOutside is true, the image is closed by clicking the top and bottom. Have you tried running the demo (https://codesandbox.io/s/react-simple-image-viewer-demo-4itlr)?

@vaultec81
Copy link
Author

vaultec81 commented Sep 1, 2021

What browser are you using? When closeOnClickOutside is true, the image is closed by clicking the top and bottom. Have you tried running the demo (https://codesandbox.io/s/react-simple-image-viewer-demo-4itlr)?

I am running on brave browser which is effectively Chrome. I will take a look at the demo and see if it's a project specific issue.

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

No branches or pull requests

2 participants