vue-drag-resize icon indicating copy to clipboard operation
vue-drag-resize copied to clipboard

working sample of dragHandle or dragCancel ?

Open padoauk opened this issue 7 years ago • 7 comments

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.

padoauk avatar Nov 18 '18 13:11 padoauk

You can try to use original package and here you can find the demo you need.

TitanFighter avatar Nov 18 '18 23:11 TitanFighter

      <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>

alexpilugin avatar Nov 21 '18 14:11 alexpilugin

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.

igasparetto avatar Jan 03 '19 15:01 igasparetto

I am having the same problem.

chopfitzroy avatar Feb 27 '19 00:02 chopfitzroy

@TitanFighter I am pretty sure these two libraries have nothing in common...?

chopfitzroy avatar Feb 27 '19 00:02 chopfitzroy

@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.

chopfitzroy avatar Feb 27 '19 01:02 chopfitzroy

Same problems occurs, without handle option, everything works fine, once added this option, the container can't be draggable anymore.

vFire avatar Nov 10 '19 07:11 vFire