brinley / jSignature

jQuery plugin for adding web signature functionality
http://www.unbolt.net/jSignature
696 stars 529 forks source link

mosueup events #25

Closed speg closed 12 years ago

speg commented 12 years ago

The jSignature mouseup event seems to be firing for other mousseupevents on the page - not just on the jSignature element.

dvdotsenko commented 12 years ago

Is this behavior causing an issue for some of your code?

This behavior is intentional. It catches cases when the user moves the mouse outside the widget and "mouseup" there. jSignature allows users to get outside and get back inside without lifting the pen, but needed this additional "mouseup" listener on window to catch pen lifted outside of area events.

speg commented 12 years ago

@dvdotsenko hi, yes it seems to be causing issues for change events on select elements. I have been able to reproduce it in a simplified snippet. The select change only works if you don't apply the jSignature. The click event fires even if you do.

Note, this only seems to happen when you have the size attribute set on the select element.

dvdotsenko commented 12 years ago

the "endDrawing" handler had "event.preventDefault"

It's fine to have it for events that start with canvas, but this handler was also used by $(window).on('mouseup'...

Naturally, it was eating all mouseup events for entire window. Fixed with 1c397301e1509a3bdf0ea1ccfcaea5405d5cdbb5