Skip to content

Commit e9d03ed

Browse files
committed
chore: update to latest version, fix event bindings
1 parent 18c9a22 commit e9d03ed

4 files changed

Lines changed: 14 additions & 23 deletions

File tree

packages/customWidgets/signature-web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"dependencies": {
3939
"classnames": "^2.5.1",
40-
"signature_pad": "4.0.0"
40+
"signature_pad": "5.1.3"
4141
},
4242
"devDependencies": {
4343
"@mendix/automation-utils": "workspace:*",

packages/customWidgets/signature-web/src/components/Signature.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,19 @@ export class Signature extends PureComponent<SignatureProps> {
5757
if (this.canvasNode) {
5858
this.signaturePad = new SignaturePad(this.canvasNode, {
5959
penColor: this.props.penColor,
60-
// @ts-expect-error // looks like this never worked, there is no onEnd in SignaturePad code
61-
onEnd: this.handleSignEnd,
6260
...this.signaturePadOptions()
6361
});
62+
this.signaturePad.addEventListener("endStroke", this.handleSignEnd);
6463
if (this.props.readOnly) {
6564
this.signaturePad.off();
6665
}
6766
}
6867
}
6968

69+
componentWillUnmount(): void {
70+
this.signaturePad?.removeEventListener("endStroked", this.handleSignEnd);
71+
}
72+
7073
UNSAFE_componentWillReceiveProps(nextProps: SignatureProps): void {
7174
if (this.signaturePad) {
7275
const { clearSignature, readOnly } = this.props;

packages/customWidgets/signature-web/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"outDir": "dist/tsc/",
55
"noEmitOnError": true,
66
"sourceMap": true,
7-
"module": "CommonJS",
7+
"module": "esnext",
88
"target": "es5",
99
"lib": ["es2015", "dom"],
1010
"moduleResolution": "node",

pnpm-lock.yaml

Lines changed: 7 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)