fix: init signature pad after CSS transition reveals canvas #28
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "4-fix-signature-pad-init-on-agree"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
$effect+transitionendlistenerChanges
src/routes/contract/[token]/+page.svelte: Removed prematuresetTimeout(initSignaturePad, 100)fromonMount. Added$effectthat watchesagreedstate and listens fortransitionendon the signature-area div before callinginitSignaturePad(). Added 450ms fallback timeout for reduced-motion. Guarded resize handler to only re-init when pad is visible.Test Plan
Review Checklist
Related Notes
project-westside-basketball-- the project this work belongs toQA Review -- PR #28
What was reviewed
Single-file Svelte bugfix:
src/routes/contract/[token]/+page.svelte(33+12 additions, 4+8 deletions across 2 commits).Findings
Issue found and fixed (commit
72550b5): Thetransitionendhandler and the 450ms fallback timeout could both fire, callinginitSignaturePad()twice. Added aninitializedflag so whichever fires first initializes the pad and cancels the other. The init function is idempotent so this was not a functional bug, but it was unnecessary work and a code quality issue.Correctness:
initSignaturePad()ran on mount when canvas had 0 dimensions (hidden by CSS toggle)$effectto watchagreedstate +transitionendevent on the signature-area divmax-heightis the correct property to wait for (400ms, the longest CSS transition, controls container dimensions)if (agreed)SOP compliance:
Closes #4in PR body for auto-closeVERDICT: APPROVE