react-image-magnify icon indicating copy to clipboard operation
react-image-magnify copied to clipboard

Unwanted line effect when hovering small (regular) image

Open benjaminadk opened this issue 6 years ago • 9 comments

I attached a pic rather than try to explain. After exploring things in devtools a little bit my best guess is that something is slightly off in a css transform: translate(), in the y-axis in two of the four divs that create the darker overlay.

Not sure how to fix this or how exactly I caused it.

Right now the ReactImageMagnify and the helper text I chose are in a div with the following css code:

    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10vh;

When I remove the margin the strange effect goes away. I have tried other css approaches - padding, transforms - to get the spacing I want, but the lines come back.

Cool Component. Any help would be appreciated. Thanks. strange lines

benjaminadk avatar Mar 06 '18 18:03 benjaminadk

Upon further messing around the lines go away when using px, rem and em units for margin. When using vh or % the lines appear. Not a perfect solution makes me think this is a larger type of issue relating more to how relative unit measurements are calculated than this component.

benjaminadk avatar Mar 06 '18 19:03 benjaminadk

@benjaminadk - Thanks for reporting this issue. I really appreciate the level of detail you provided. I'm wondering which Web browser(s) and operating system you experienced this on.

ethanselzer avatar Mar 08 '18 06:03 ethanselzer

@ethanselzer - no problem. I am on Windows 10 and Chrome 64

benjaminadk avatar Mar 09 '18 11:03 benjaminadk

Same problem. Windows 10, chrome 64, opera too. In edge the problem is visible for about half second and disappearing until I change photo

artuswo443 avatar Mar 28 '18 13:03 artuswo443

@artuswo443 - Thanks for your report. I'm sorry for the problem. Does your containing element implements vh or % units, like benjaminadk's did.

ethanselzer avatar Mar 30 '18 00:03 ethanselzer

Same here. I'm using the magnifier inside a container with percentage width. The calculated heights and y-positions of the semi-transparent boxes are floating point numbers (.5) so this may cause the horizontal lines.

ghost avatar Apr 12 '18 09:04 ghost

Thanks to all who reported this issue. I really appreciate it. A patch has been released that may correct the problem. Please have a look at the demo site and install v2.6.3 on your projects. Please let me know your findings.

ethanselzer avatar Apr 15 '18 05:04 ethanselzer

Patch in 2.6.3 fixed the issue! Thanks @ethanselzer.

evannoronha avatar Apr 16 '18 20:04 evannoronha

I spoke too soon. The issue is still present on Edge and IE 11.

evannoronha avatar Apr 21 '18 01:04 evannoronha