forked from blackjk3/react-signature-pad
-
Notifications
You must be signed in to change notification settings - Fork 128
Signature Rendering Issue with Stylus on Touchscreen Devices (Microsoft Surface) #136
Copy link
Copy link
Open
Labels
problem: no reproNo reproduction was provided (and have not tried to repro without one)No reproduction was provided (and have not tried to repro without one)problem: removed issue templateOP removed the issue template without good causeOP removed the issue template without good causeproblem: unverified LLM generationThis has various hallmarks of unverified LLM usage, which is problematic for many reasonsThis has various hallmarks of unverified LLM usage, which is problematic for many reasonssolution: duplicateThis issue or PR is a duplicate of another existing oneThis issue or PR is a duplicate of another existing one
Metadata
Metadata
Assignees
Labels
problem: no reproNo reproduction was provided (and have not tried to repro without one)No reproduction was provided (and have not tried to repro without one)problem: removed issue templateOP removed the issue template without good causeOP removed the issue template without good causeproblem: unverified LLM generationThis has various hallmarks of unverified LLM usage, which is problematic for many reasonsThis has various hallmarks of unverified LLM usage, which is problematic for many reasonssolution: duplicateThis issue or PR is a duplicate of another existing oneThis issue or PR is a duplicate of another existing one
Summary
When using a stylus (e.g., Surface Pen) on a touchscreen device like the Microsoft Surface, lines are not consistently rendered on the canvas. The pen input is detected (events fire), but strokes fail to appear visually or appear inconsistently.
Affected Package
react-signature-canvas: ^1.1.0-alpha.2Internally depends on
signature_pad: ^2.3.2✅ Issue resolved in
signature_pad>= 5.0.7 (tested with this version)Device and Environment
Steps to Reproduce
react-signature-canvason a Microsoft Surface or similar device with a stylus.Expected Behavior
Lines should render smoothly and reliably when drawing with a stylus, just like with mouse or finger.
Actual Behavior
Cause
The issue originates in
signature_pad@2.3.2, which does not handlepointerType+pressurecorrectly in certain pen input scenarios. This was fixed in later versions ofsignature_pad.Fix Reference
Older versions of
signature_paddid not handle pen input correctly whenPointerEvent.pressure === 0during thepointerdownevent — a case commonly observed on touchscreen devices like Microsoft Surface. This caused_strokeBegin()to be skipped, resulting in no lines being drawn.✅ Recommended Action: Upgrade to
signature_pad@5.0.7or later to ensure correct stylus input behavior across devices.Suggested Fix
Upgrade
react-signature-canvasto usesignature_pad@^5.0.7instead of^2.3.2.Video
currently: https://github.com/user-attachments/assets/0f5e5685-6fec-471d-9189-e4232b3c4761
with updated to
signature_pad@^5.0.7version: https://github.com/user-attachments/assets/b2a53289-d3f5-4915-a4bc-0fde4d53d27f