Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent multiply pointers drawing #788

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wokayme
Copy link

@wokayme wokayme commented Aug 30, 2024

Fix following issue:
#787

Using native api for pointerEvents:
https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent/isPrimary

Copy link
Collaborator

@UziTech UziTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test that uses multi touch

@@ -386,7 +390,11 @@ export default class SignaturePad extends SignatureEventTarget {
};

private _handlePointerMove = (event: PointerEvent): void => {
if (!this._isLeftButtonPressed(event, true) || !this._drawingStroke) {
if (
!event.isPrimary ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should just return if !event.isPrimary adding it to this if will end the stroke. We should also return from _handlePointerUp if !event.isPrimary.

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.

2 participants