thread-pond / signature-pad

A jQuery plugin for assisting in the creation of an HTML5 canvas based signature pad. Records the drawn signature in JSON for later regeneration.
BSD 3-Clause "New" or "Revised" License
727 stars 292 forks source link

Event Binding Issue #170

Open nspatilk opened 8 years ago

nspatilk commented 8 years ago

This is regarding below mentioned pull request.

https://github.com/nspatilk/signature-pad/pull/1

This pull request was raised because of below mentioned statement in jquery.signaturepad.js/ jquery.signaturepad-min.js.

$( “input” ).blur();

Essentially the above line means that it will look for all input element in the DOM and fire a blur event on to it. Even though signature element is not in focus blur event is getting triggered which is not correct.

Below is the proposed solution which will be specific binding. Blur event will be fired only when signature element is in focus.

Making binding of blur event more specific. With this change blur event will be triggered only when signature pad is in focus. Without this change blur event is fired even if focus is not on signature canvas. Binding on just "input" element is too generic which can easily get in conflict with other "input" elements present in the web page.

thomasjbradley commented 8 years ago

Yep, it's a good idea, unfortunately I won't be able to get the change in any time soon.