Skip to content

Commit e354eba

Browse files
committed
fixes touch on android (jbaysolutions#110)
1 parent 45bb762 commit e354eba

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/GridItem.vue

Lines changed: 9 additions & 3 deletions
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' : resizable, 'resizing' : isResizing, 'vue-draggable-dragging' : isDragging, 'cssTransforms' : useCssTransforms, 'render-rtl' : renderRtl, 'disable-userselect': isDragging }"
4+
:class="{ 'vue-resizable' : resizable, 'resizing' : isResizing, 'vue-draggable-dragging' : isDragging, 'cssTransforms' : useCssTransforms, 'render-rtl' : renderRtl, 'disable-userselect': isDragging, 'no-touch': isAndroid }"
55
:style="style"
66
>
77
<slot></slot>
@@ -13,11 +13,14 @@
1313
.vue-grid-item {
1414
transition: all 200ms ease;
1515
transition-property: left, top, right;
16-
-ms-touch-action: none;
17-
touch-action: none;
1816
/* add right for rtl */
1917
}
2018
19+
.vue-grid-item.no-touch {
20+
-ms-touch-action: none;
21+
touch-action: none;
22+
}
23+
2124
.vue-grid-item.cssTransforms {
2225
transition-property: transform;
2326
left: 0;
@@ -371,6 +374,9 @@
371374
}
372375
},
373376
computed: {
377+
isAndroid() {
378+
return navigator.userAgent.toLowerCase().indexOf("android") !== -1;
379+
},
374380
renderRtl() {
375381
return (this.$parent.isMirrored) ? !this.rtl : this.rtl;
376382
},

0 commit comments

Comments
 (0)