Skip to content

Commit

Permalink
Merge pull request #6368 from surveyjs/bug/6353-signature-pad-pixel-bug
Browse files Browse the repository at this point in the history
Signature Pad issue on Android Pixel devices - A previously defined signature is reset
  • Loading branch information
andrewtelnov authored Jun 16, 2023
2 parents 9848995 + 08e1830 commit b9460b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
}
},
"dependencies": {
"signature_pad": "^2.3.2",
"signature_pad": "^4.1.5",
"vite": "^3.1.8"
}
}
11 changes: 7 additions & 4 deletions src/question_signaturepad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,17 @@ export class QuestionSignaturePadModel extends Question {

signaturePad.penColor = this.penColor;
signaturePad.backgroundColor = this.backgroundColor;
signaturePad.onBegin = () => {

signaturePad.addEventListener("beginStroke", () => {
this.isDrawingValue = true;
canvas.focus();
};
signaturePad.onEnd = () => {
}, { once: true });

signaturePad.addEventListener("endStroke", () => {
this.isDrawingValue = false;
this.updateValue();
};
}, { once: true });

var updateValueHandler = () => {
var data = this.value;
canvas.width = this.signatureWidth || defaultWidth;
Expand Down

0 comments on commit b9460b2

Please sign in to comment.