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
730 stars 290 forks source link

Pad setup very slow if there are many input blur bindings #161

Open alonbardavid opened 9 years ago

alonbardavid commented 9 years ago

in the function initDrawEvents there is a call to $('input').blur(). Which causes every input to get a "blur" event.

If there are many inputs and the blur event is heavy there this can cause a very long delay until drawing can happen.

This happened to me with a very large angular application, which in ever blur causes a "digest cycle" (a way for angular to test if there are any changes).

alonbardavid commented 9 years ago

In general I think that this should be something that the caller should handle. What if the user wants to keep the focus on something else when initiating the pad? or doesn't want the "keyboard" to be hidden (which is the reason given in the source code for this action).

thomasjbradley commented 9 years ago

Yeah, that makes sense to me.