vue-drag-resize
vue-drag-resize copied to clipboard
working sample of dragHandle or dragCancel ?
Hi.
Are there any working samples of dragHandle or dragCancel ? I tried the following but did not work. Please let me know.
<vue-drag-resize dragHandle=".drag" with_other_properties>
<div class="drag">Draggable</div>
<div>Not Draggable</div>
</vue-drag-resize>
When this code runs, the div is like the following, but it is not draggable.
<div class="drag" data-v-102b6da1="" data-drag-handle="13">Draggable</div>
Thanks.
You can try to use original package and here you can find the demo you need.
<div v-for="(item, index) in textboxes" :key="`textbox-${index}`">
<VueDragResize
:v-show="!item.deleted"
:w="item.w"
:h="item.h"
:x="item.x"
:y="item.y"
dragHandle=".drag"
v-on:dragging="moveText($event, index)"
@clicked="item.active=true"
:isActive="false"
:isResizable="true"
>
<div class="drag" :v-show="item.active">
<span class="remove-text" @click="removeText(index)">⨉</span>
</div>
</VueDragResize>
<p class="textbox"
v-show="!item.deleted"
:ref="`text${index}`"
@input="updateTrText($event, index)"
v-bind:style="{ top: item.y + 'px', left: item.x + 'px', width: item.w + 'px', height:item.h-20 + 'px'}"
>Text</p>
</div>
dragHandle=".drag"
Doesn't work. Am I the only having problems here?
On click on the handle, draggable="false" changes to draggable="true"
It drags around correctly when dragHandle is not set.
I am having the same problem.
@TitanFighter I am pretty sure these two libraries have nothing in common...?
@igasparetto @padoauk try making your draggable (.drag) element position: relative I just spent a while debugging this and it was literally just that the click event wasn't bubbling from the draggable element because of the CSS associated with it.
Same problems occurs, without handle option, everything works fine, once added this option, the container can't be draggable anymore.