Noction / vue-draggable-grid

https://noction.github.io/vue-draggable-grid/
81 stars 33 forks source link

Not able to use dragAllowFrom or dragIgnoreFrom #73

Open anubhavs19 opened 1 month ago

anubhavs19 commented 1 month ago

Summary: I have successfully created the grids and everything works except for dragAllowFrom and dragIgnoreFrom, the selectors I am passing are child elements of root grid item, I hope that is not a problem

Code:

  <grid-layout
    v-model:layout="layout"
    :col-num="3"
    :row-height="height"
    :is-draggable="editMode"
    :is-resizable="editMode"
    @noc-item-move-end="handleMoveEnd"
  >
      <template
          #gridItemContent="slotProp"
      >
          <div class="grid-item-root">
              ...
              <span class="drag-handle">
              ICON
              </span>
              ...
              <span class="no-drag">
              ICON
              </span>
              ...
          </div>
      </template>
  </grid-layout>
    layout = [{
        x: 0, y: 5, w: 3, h: 2.5, id: 'MY_LIST', dragIgnoreFrom: '.no-drag', dragAllowFrom: '.drag-handle'
    }]