Skip to content

How to not move items / How to only call callback/emit change event? #1874

Description

@igorlvicente

My problem is that I use Sortable with Vue.
That means that the array (therefore the order of the items) are defined by a state outside of Sortable and DOM.
I have this problem that I was not able to solve:

  1. Move item from position initial to final
  2. onEnd calls callback or parent's callback
  3. Validate some rules. Item should not be moved.
  4. Show error on screen for user
  5. List on state keeps the original order (item is in position initial)
  6. DOM has the wrong order final

I think the way would it be to not change the order on DOM, just trigger a change to be handled for whatever has the power.
I don't know if I make myself clear enough, but any questions, let me know.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions