@@ -359,9 +359,15 @@ export class Canvas {
359359 this . externalElements . ondrop = this . ondrop ;
360360 this . externalElements . oncontextmenu = ( e ) => e . preventDefault ( ) ;
361361 this . store . options . interval = 50 ;
362- this . externalElements . ontouchstart = this . ontouchstart ;
363- this . externalElements . ontouchmove = this . ontouchmove ;
364- this . externalElements . ontouchend = this . ontouchend ;
362+ if ( this . store . options . parentTouch ) {
363+ this . parentElement . ontouchstart = this . ontouchstart ;
364+ this . parentElement . ontouchmove = this . ontouchmove ;
365+ this . parentElement . ontouchend = this . ontouchend ;
366+ } else {
367+ this . externalElements . ontouchstart = this . ontouchstart ;
368+ this . externalElements . ontouchmove = this . ontouchmove ;
369+ this . externalElements . ontouchend = this . ontouchend ;
370+ }
365371 this . externalElements . onmousedown = ( e ) => {
366372 if ( this . isMobile ) {
367373 return ;
@@ -9250,9 +9256,15 @@ export class Canvas {
92509256
92519257 this . externalElements . ondragover = ( e ) => e . preventDefault ( ) ;
92529258 this . externalElements . ondrop = undefined ;
9253- this . externalElements . ontouchstart = undefined ;
9254- this . externalElements . ontouchmove = undefined ;
9255- this . externalElements . ontouchend = undefined ;
9259+ if ( this . store . options . parentTouch ) {
9260+ this . parentElement . ontouchstart = undefined ;
9261+ this . parentElement . ontouchmove = undefined ;
9262+ this . parentElement . ontouchend = undefined ;
9263+ } else {
9264+ this . externalElements . ontouchstart = undefined ;
9265+ this . externalElements . ontouchmove = undefined ;
9266+ this . externalElements . ontouchend = undefined ;
9267+ }
92569268 this . externalElements . onmousedown = undefined ;
92579269 this . externalElements . onmousemove = undefined ;
92589270 this . externalElements . onmouseup = undefined ;
0 commit comments