vue-smooth-dnd icon indicating copy to clipboard operation
vue-smooth-dnd copied to clipboard

Unlock axis

Open vukadinFE opened this issue 5 years ago • 2 comments

Hello. Is there any way to unlock axis for Draggable element if parent Container has, for example, lock-axis="x" ?

Thanks for great work.

vukadinFE avatar Dec 14 '18 11:12 vukadinFE

There is lock-axis property to drag along a straight line, if that what you asked

kutlugsahin avatar Jan 21 '19 12:01 kutlugsahin

I can lock axis to entire container like this:

    <Container
      @drop="onDrop"
      drag-handle-selector=".column-drag-handle"
      lock-axis="y">
      <Draggable
        v-for="item in $store.state.items"
        :key="item.id">
          <item :id="item.id"  />
      </Draggable>
    </Container>

But I want to lock axis to certain items only, like so:

    <Container
      @drop="onDrop"
      drag-handle-selector=".column-drag-handle">
      <Draggable
        v-for="item in $store.state.items"
        :lock-axis="item.lock ? 'y' : undefined"
        :key="item.id">
          <item :id="item.id"  />
      </Draggable>
    </Container>

This is not working currently. Is that any way to get desired effect? Thanks

vukadinFE avatar Feb 25 '19 10:02 vukadinFE