refactor(Dashboard touch events): allows to scroll on mobile over widgets, fixes dragging bug on mobile

This commit is contained in:
SimonGschnell
2025-05-23 11:33:58 +02:00
parent 4a10faeb25
commit ad8963e5b5
2 changed files with 20 additions and 23 deletions
+10 -4
View File
@@ -64,19 +64,25 @@ export default {
this.registerDragAction(event);
this.tryDragStart(event, this.item);
},
touchMove(event){
if(this.dragging){
event.preventDefault();
this.$emit('dragging', event);
}
}
},
template: `
<div class="drop-grid-item"
@mousedown="registerDragAction"
@mouseup="$emit('mouseUp', $event)"
@touchstart.prevent="touchStart"
@touchstart="touchStart"
@touchend="touchDragEnd"
@dragstart="tryDragStart($event, item)"
@drag="$emit('dragging',$event)"
@touchmove.prevent="$emit('dragging',$event)"
@dragend="$emit('endDrag', $event)"
:draggable="active && !item.placeholder && dragAction != ''">
@touchmove="touchMove"
@dragend="$emit('endDrag', $event); dragging = false"
:draggable="active && !item.placeholder && dragging">
<slot v-bind="item"></slot>
</div>`
}