Closed andreabalducci closed 11 years ago
Technically the canvas is of exactly the right size. jSignature adapts to the size of the parent div. What's wrong size is the hidden tab, likely to be 0x0 in size while it's hidden.
What I would suggest is to show the tab first, and, then, init the signature against it. This way, by the time jSignature is about to be created, the tab will have the right size.
http://stackoverflow.com/questions/11329405/twitter-bootstrap-attach-action-on-tab-when-initialized
the tab is binded with angular-bootstrap and I've a directive for the signature. As a workaround I managed to fix the issue triggering a resize event to the parentdiv with jquery on tab activation $('#signatureparent').resize();
I just had the same problem. The $('#signatureparent').resize();
solution didn't work (caused some problems with getData and setData)
My solution was just to set the width/height when initializing, e.g.:
$("#signatureparent").jSignature({width:100});
The signature canvas has wrong size when the jSignature is called on a non visible tab.
http://jsfiddle.net/gD8QC/