cdig / svga

A framework for making interactive animations with SVG.
https://github.com/cdig/svga/wiki
MIT License
8 stars 2 forks source link

Highlight effect continues even after mouse out #107

Closed Nathanoid closed 8 years ago

Nathanoid commented 8 years ago

Can the highlighter be changed a bit so that the animation stops immediately when the user mouses out? Maybe have the animation stop when the user clicks/taps the button?

ivanreese commented 8 years ago

Yes. It was doing that before, but I liked it better with the timeout so I changed it (and I think the timeout works better in some edge cases). I can change it back.

ivanreese commented 8 years ago

Ah. I remember why I changed this. If you cease the highlight effect on mouse-out, then users on touchscreen Windows aren't able to use the highlight effect (because of the way Windows handle mouse vs touch events). So, by using the current approach, the highlight effect works reliably across mice, touchscreen Windows, and iOS/Android.

I'm going to leave the effect the way it is for now, but I'll keep this issue open in the hope of figuring out some other way to get this working reliably across all platforms.

ivanreese commented 8 years ago

I have somewhat worked around the issues on Windows. It's not great, but it's good enough for now. Thus, the mouse behaviour has been changed to cease the effect on mouseout. I also tested ceasing the effect on click, but that had negative consequences for touch devices, and distinguishing between the two is too tricky at this time.