loupe-js
loupe-js copied to clipboard
after a while, loupe occassionally fails to disappear when leaving the image
To reproduce: Repeatedly hover over and out of the target image. In most cases the loupe disappears as expected. After a while, in some cases, the loupe remains visible even when the mouse is moved out of the image.
I think it is because there's a race, either we remove the event listener first or we recalculate the exit condition
the exitDistance should be half of the width for x and half of the height for y from the magnifier glass
Just submitted a new PR @nishanths