Skip to content

fix(signature): gate onChange emission behind requireAccept flag - #1115

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
DevRushd:fix/signature-capture-gate
Jul 30, 2026
Merged

fix(signature): gate onChange emission behind requireAccept flag#1115
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
DevRushd:fix/signature-capture-gate

Conversation

@DevRushd

Copy link
Copy Markdown
Contributor

Description

The end() stroke handler in SignatureCapture was emitting onChange(dataUrl) on every stroke regardless of the requireAccept prop. This allowed parent components to receive and commit the signature before the user pressed the "Accept" button, bypassing the approval gate entirely.

Fix

  • The end callback now only calls onChange when requireAccept is false or undefined.
  • When requireAccept is true, only the explicit "Accept" button click handler (handleAccept) emits the data URL.
  • Added requireAccept to the end callback's dependency array for correctness.

Testing

  • With requireAccept={true}: signatures are only committed via the Accept button.
  • With requireAccept={false} or omitted: signatures emit on every stroke as before (no breaking change for existing callers).

Closes #1040

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@DevRushd Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Thank you for contributing to the project.

@RUKAYAT-CODER
RUKAYAT-CODER merged commit 1524dce into rinafcode:main Jul 30, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Do not emit signature before Accept when requireAccept is set in SignatureCapture

2 participants