-
-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Zooming effect breaks when images is clicked while scrolling #439
Comments
@Binibeno I can't reproduce this on macOS after trying for a few minutes (Chrome, Firefox, Safari), so it might be confined to Windows. If that's the case, I'll need to reproduce it there and use that for testing any fixes that need to be made. Code contributions to the project are also welcome! If you are interested in that, see the contributing guide for more information. If you're able to make a screen recording of the issue, that would be very helpful! If not, that's ok, too. |
I created a screen recording, I've attached it with this reply. Hope this helps! It only seems to happen when I'm using a mouse, not on touchpad or touchscreen. second.try.mp4 |
@Binibeno This is great! Thank you for taking the time to make the video. |
Yep, I just ran into this issue with my Logitech mouse. Will fix up |
It feels like a lot of the bugs on this lib are unfortunately caused by the use of listening for |
@tommoor I haven't tallied all the sources of bugs, but that doesn't feel right to me to say. I won't know until I dig in, and this is my next priority. |
I can't use a mouse until tomorrow or the next day, but looking at the logic, the first thing I'm going to look at is the use of the react-medium-image-zoom/source/Controlled.tsx Line 622 in 8040ab2
|
@Binibeno This should be resolved in |
Issue Type
Description
As per the title says, the zooming effect becomes broken if the pages is being scrolled when the images is clicked. It sometimes takes a few tries to get but when the images does get stuck, the page becomes unusable, because this component blocks the scrolling and interaction with any other part of the page. The close icon does appear on the top right side of the page but it is not clickable.
There is no special config needed to reproduce this issue, it works on every storybook demo, where there is space to scroll.
For example this one: https://rpearce.github.io/react-medium-image-zoom/?path=/story/galleries--image-gallery
I've tried hacking around this issue by disabling scroll (setting the html body's overflow to hidden) when the image is clicked, but it did not work.
(I'm using Chrome 115 and Windows if that matters)
If anyone has any hacks or possible fixes for this please let me know! Maybe anyone has any alternative packages I can switch to, that function similarly to this one?
Any help would be appreciated!
The text was updated successfully, but these errors were encountered: