diff --git a/src/plugins/Drag.ts b/src/plugins/Drag.ts index c815ce4..bd16efd 100644 --- a/src/plugins/Drag.ts +++ b/src/plugins/Drag.ts @@ -102,6 +102,13 @@ export interface IDragOptions * @default false */ wheelSwapAxes?: boolean; + + /** + * Disable drag on touch. + * + * @default false + */ + disableTouch?: boolean; } const DEFAULT_DRAG_OPTIONS: Required = { @@ -118,6 +125,7 @@ const DEFAULT_DRAG_OPTIONS: Required = { ignoreKeyToPressOnTouch: false, lineHeight: 20, wheelSwapAxes: false, + disableTouch: false, }; /** @@ -308,6 +316,10 @@ export class Drag extends Plugin const isMouse = event.pointerType === 'mouse'; const count = this.parent.input.count(); + if (!isMouse && this.options.disableTouch && count === 1) { + return false; + } + if (count === 1 || (count > 1 && !this.parent.plugins.get('pinch', true))) { if (!isMouse || this.mouse[event.button])