Skip to content

Commit

Permalink
fix: set user-select none on canvas (#591)
Browse files Browse the repository at this point in the history
  • Loading branch information
marmooo committed Jan 21, 2022
1 parent 12e4dcb commit 59ff331
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/signature_pad.ts
Expand Up @@ -151,6 +151,7 @@ export default class SignaturePad extends SignatureEventTarget {
// Disable panning/zooming when touching canvas element
this.canvas.style.touchAction = 'none';
this.canvas.style.msTouchAction = 'none';
this.canvas.style.userSelect = 'none';

const isIOS =
/Macintosh/.test(navigator.userAgent) && 'ontouchstart' in document;
Expand All @@ -172,6 +173,7 @@ export default class SignaturePad extends SignatureEventTarget {
// Enable panning/zooming when touching canvas element
this.canvas.style.touchAction = 'auto';
this.canvas.style.msTouchAction = 'auto';
this.canvas.style.userSelect = 'auto';

this.canvas.removeEventListener('pointerdown', this._handlePointerStart);
this.canvas.removeEventListener('pointermove', this._handlePointerMove);
Expand Down

0 comments on commit 59ff331

Please sign in to comment.