-
Notifications
You must be signed in to change notification settings - Fork 195
Open
Description
Hello,
I am having problems accessing the methods you described via Refs.
I keep getting signature.clear is not a function
Here's my code
Signature = React.createClass({
displayName:"Signature",
clearSig(){
var signature = React.findDOMNode(this.refs.mySignature);
signature.clear();
},
acceptSig(){
var signature = React.findDOMNode(this.refs.mySignature);
if(signature.isEmpty()){
alert('Please sign the agreement');
return;
}
var sigImage = signature.toDataURL();
console.log(sigImage);
},
render:function(){
return(
<div>
<SignaturePad ref="mySignature" />
<div className="signature-bottom">
<div className="pull-left">
<div onClick={this.clearSig} className="btn reset">
Clear Signature
</div>
</div>
<div className="pull-right">
By clicking accept you agree to the terms stated above.
<div onClick={this.acceptSig} className="btn save pull-right">
Save & Accept
</div>
</div>
</div>
</div>
);
}
});
Can you help point me in the right direction?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels