File tree Expand file tree Collapse file tree 3 files changed +8
-15
lines changed
src/atoms/forms/canvas-sketch/tools Expand file tree Collapse file tree 3 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -269,9 +269,6 @@ class LineCanvasDrawTool extends BaseCanvasDrawTool implements CanvasDrawTool {
269269
270270 private _onTouchEndWindow ( e : TouchEvent ) : void {
271271 this . _finishStroke ( ) ;
272-
273- // Don't allow touch events to be called
274- e . preventDefault ( ) ;
275272 }
276273
277274 private _onTouchMoveCanvas ( e : TouchEvent ) : void {
@@ -283,7 +280,7 @@ class LineCanvasDrawTool extends BaseCanvasDrawTool implements CanvasDrawTool {
283280 this . _move ( touchPosition ) ;
284281 }
285282
286- // Don't allow touch events to be called
283+ // prevents scrolling screen (if inside scrollable content)
287284 e . preventDefault ( ) ;
288285 }
289286
@@ -296,7 +293,8 @@ class LineCanvasDrawTool extends BaseCanvasDrawTool implements CanvasDrawTool {
296293 this . _startStroke ( touchPosition ) ;
297294 }
298295
299- // Don't allow touch events to be called
296+ // prevents click event from firing when not moving / gesturing with touch
297+ // effectively duplicating drawing stroke
300298 e . preventDefault ( ) ;
301299 }
302300
Original file line number Diff line number Diff line change @@ -178,9 +178,6 @@ class PanCanvasTool {
178178
179179 private _onTouchEndWindow ( e : TouchEvent ) : void {
180180 this . _finishPan ( ) ;
181-
182- // Don't allow touch events to be called
183- e . preventDefault ( ) ;
184181 }
185182
186183 private _onTouchMoveCanvas ( e : TouchEvent ) : void {
@@ -192,7 +189,7 @@ class PanCanvasTool {
192189 this . _pan ( touchPosition ) ;
193190 }
194191
195- // Don't allow touch events to be called
192+ // prevents scrolling screen (if inside scrollable content)
196193 e . preventDefault ( ) ;
197194 }
198195
@@ -205,7 +202,7 @@ class PanCanvasTool {
205202 this . _startPan ( touchPosition ) ;
206203 }
207204
208- // Don't allow touch events to be called
205+ // prevents click event from firing when not moving / gesturing with touch
209206 e . preventDefault ( ) ;
210207 }
211208
Original file line number Diff line number Diff line change @@ -344,9 +344,6 @@ class PencilCanvasDrawTool extends BaseCanvasDrawTool
344344
345345 private _onTouchEndWindow ( e : TouchEvent ) : void {
346346 this . _finishStroke ( ) ;
347-
348- // Don't allow touch events to be called
349- e . preventDefault ( ) ;
350347 }
351348
352349 private _onTouchMoveCanvas ( e : TouchEvent ) : void {
@@ -358,7 +355,7 @@ class PencilCanvasDrawTool extends BaseCanvasDrawTool
358355 this . _move ( touchPosition ) ;
359356 }
360357
361- // Don't allow touch events to be called
358+ // prevents scrolling screen (if inside scrollable content)
362359 e . preventDefault ( ) ;
363360 }
364361
@@ -371,7 +368,8 @@ class PencilCanvasDrawTool extends BaseCanvasDrawTool
371368 this . _startStroke ( touchPosition ) ;
372369 }
373370
374- // Don't allow touch events to be called
371+ // prevents click event from firing when not moving / gesturing with touch
372+ // effectively duplicating drawing stroke
375373 e . preventDefault ( ) ;
376374 }
377375
You can’t perform that action at this time.
0 commit comments