#3403·documenso

Signature pad draws a stray stroke from the click that opens it

Author: johnmichaeld-resbCreated Sep 28, 2026Updated Sep 28, 2026
Labelsstatus: triage

Issue Description

When a signer clicks a signature field on the document, the signature dialog opens while the mouse button is still held down. If the drawing pad appears under the pointer, releasing the click draws a short stroke on the pad. The signer sees a mark they never drew, plus "Signature is too small", and has to press "Clear Signature" before they can sign.

Two pieces of code combine:

  1. apps/remix/app/components/general/envelope-signing/envelope-signer-page-renderer.tsx opens the field on pointerdown (fieldGroup.on('pointerdown', handleFieldGroupClick)), so the button is still down when the dialog renders.
  2. packages/ui/primitives/signature-pad/signature-pad-draw.tsx: onMouseEnter (bound to onPointerEnter) calls onMouseDown whenever event.buttons === 1. That is meant to let a stroke continue when the pointer re-enters the pad, but here it also starts a stroke for a press that began outside the pad, before the pad existed.

Steps to Reproduce

  1. Open a document for signing (embed or regular signing page) with a signature field positioned so that the signature dialog's draw area opens over it (e.g. scroll the field to mid-screen).
  2. Press the mouse button on the signature field and hold it until the dialog appears.
  3. Move the mouse slightly and release.

Expected Behavior

The pad stays empty until the signer presses on it.

Current Behavior

A short stroke is drawn from where the pointer entered the pad to where the button was released, and "Signature is too small" is shown.

Suggested fix

Only continue a stroke on pointerenter when the press began on the pad. For example, set a flag in the canvas's onPointerDown/onPointerUp and check it in onPointerEnter. A freshly opened pad then ignores the press that opened it, while dragging out of the pad and back in still continues the stroke. (Opening the field on click instead of pointerdown would also avoid it, but that handler serves every field type.)

We are running this as a patch on v2.18.0 and verified it in Chromium: before the patch the opening click inked ~650 pixels and showed "Signature is too small"; after it, 0 pixels, and ordinary strokes, leave-and-re-enter strokes and Sign all still work.

Operating System

Ubuntu 26.04 (also reproduced in headless Chromium on Linux)

Browser

Firefox 156, Chromium

Version

v2.18.0 (Docker image)