Closed zhil closed 8 months ago
I'm not sure that there's anything we can really do about a Chrome regression, especially in this tiny wrapper
Sorry, I didnt realize, that this library is a wrapper.
I reported issue here https://github.com/szimek/signature_pad/issues/734
@agilgur5 native library author proposed solution, but I cant use it
https://github.com/szimek/signature_pad/issues/734
You can opt in with something like this:
signaturePad.addEventListener("afterUpdateStroke", () => {
window.resize();
});
I cant find any way to add event listener. I tried to use code like
sigPadRef.current._sigPad.addEventListener("afterUpdateStroke", () => {
console.log('ACA-512 patch');
window.resize();
});
<SignatureCanvas ref={sigPadRef} ..... />
but its not working.
Also I cant find any props like OnAfterUpdateStroke etc. :(
Also I cant find any props like OnAfterUpdateStroke etc. :(
Yes that's part of the signature_pad
v4 API. react-signature-canvas
is still on v2 as v4 had many breaking changes that no contributor has attempted to address yet. See also #68
You can use the onEnd
prop/callback which is roughly equivalent to v4's afterUpdateStroke
.
After recent Google Chrome update I noticed, that react-signature-canvas is not working correctly any more.
Line is showed as dotted line and auto-removed.
Here is online sandbox https://codesandbox.io/s/react-signature-canvas-example-forked-v2qrkh?file=/src/App.js
Not working in Google Chrome 117.0.5938.132 on Ubuntu![bug](https://github.com/agilgur5/react-signature-canvas/assets/981783/023fb0a5-436e-4b1f-b202-1ce47f6da914)
Works just fine in Firefox on the same PC![bug](https://github.com/agilgur5/react-signature-canvas/assets/981783/4e95d5e3-dc97-4fa2-81f7-1564451af6d7)