AviKKi / hover-preview

A vanilla js library to show preview images on hover
7 stars 17 forks source link

Timeout/Interval bug #7

Closed AviKKi closed 3 years ago

AviKKi commented 3 years ago

There is a bug in this plugin

Visit this website, hover over an image, then move your cursor very fast in and out of the image, the images will start flickering which is not expected they only change after a delay of 500ms

I'm not sure what is happening maybe mouseleave event is not registered and mousein event is registered twice thrice by moving cursor in and out.

Possible patches

  1. using correct events from mouseleave, mouseout, mousein .... may fix this issue
  2. set a timeout and interval variable and avoid setting multiple timeout and intervals at once. or maybe Find out what is causing the race condition and a better way to code this plugin.
LoganxDev commented 3 years ago

I'd like to take a shot at this one. :)

AviKKi commented 3 years ago

@LoganxDev go for it

rohansp commented 3 years ago

@AviKKi I would like to contribute. I see all issues are taken up. Do you have any open issues?

joshnho commented 3 years ago

Hi i would like to try this out also

AviKKi commented 3 years ago

Hello @rohansp and @joshnho I currently don't have any more issue, if you want to contribute you can raise a feature request and work on it.

Or star/watch the repo for upcoming issues.

AviKKi commented 3 years ago

fixed in https://github.com/AviKKi/hover-preview/pull/13