vue-image-compare
vue-image-compare copied to clipboard
Mouse event bug
Hi, I have noticed problem on comparing full-sized images. When you set image-compare-handler to the left edge(max value allowed by padding property) you get fatal like this: vue-image-compare.min.js:1 Uncaught TypeError: Cannot read property '0' of undefined at a.onMouseMove (vue-image-compare.min.js:1) at a.n [as onMouseMove] (vue.min.js:6) at mousemove (vue-image-compare.min.js:1) at HTMLElement.invoker (vue.min.js:6)
After this error, you can't use image-compare-handler anymore. What is strange, this error doesn't appear on the right side. Even here: https://marcincichocki.github.io/vue-image-compare/ on full size demo you can observe this bug.
@Meliasz Yes, this bug appear when event.pageX
is equal to 0
on desktop devices. (https://github.com/marcincichocki/vue-image-compare/blob/master/src/vue-image-compare.vue#L85). Should be fixed when I release v1.0.0. In the meantime you can set left padding to 1
to get around it.