Skip to content

Commit f013f92

Browse files
committed
Fix: no-touch on mobile and only if item is draggable or resizable
1 parent 1268818 commit f013f92

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/components/GridItem.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div ref="item"
33
class="vue-grid-item"
4-
:class="{ 'vue-resizable' : resizableAndNotStatic, 'static': static, 'resizing' : isResizing, 'vue-draggable-dragging' : isDragging, 'cssTransforms' : useCssTransforms, 'render-rtl' : renderRtl, 'disable-userselect': isDragging, 'no-touch': isAndroid }"
4+
:class="classObj"
55
:style="style"
66
>
77
<slot></slot>
@@ -380,9 +380,24 @@
380380
}
381381
},
382382
computed: {
383+
classObj() {
384+
return {
385+
'vue-resizable' : this.resizableAndNotStatic,
386+
'static': this.static,
387+
'resizing' : this.isResizing,
388+
'vue-draggable-dragging' : this.isDragging,
389+
'cssTransforms' : this.useCssTransforms,
390+
'render-rtl' : this.renderRtl,
391+
'disable-userselect': this.isDragging,
392+
'no-touch': this.isAndroid && this.draggableOrResizableAndNotStatic
393+
}
394+
},
383395
resizableAndNotStatic(){
384396
return this.resizable && !this.static;
385397
},
398+
draggableOrResizableAndNotStatic(){
399+
return (this.draggable || this.resizable) && !this.static;
400+
},
386401
isAndroid() {
387402
return navigator.userAgent.toLowerCase().indexOf("android") !== -1;
388403
},

0 commit comments

Comments
 (0)