[F7Vue] smart-select sortable?

Is there a way to make the list in a smart-select sortable?

I use it similar to the ‘Car’ example in kitchen-sink, but would also like to drag the list-items to re-arrange…

1 Like

Well, a bit hacky, and it is not indended for such, but possible :slight_smile: here is the example https://jsfiddle.net/c97guxr5/

1 Like

Great! Thanks…

there’s still one problem:

I can drag the list-items and I also get the sortableSort event, but as soon as I release the mouse, the list-item jumps back to it’s original position (as if I would have released the mouse outside)

this.$f7.on('sortableSort', function(listEl, indexes) {
       console.log(listEl, indexes);
}

Any ideas?

Do you try something to do on sort? I can see it works correctly in Fiddle

I copied my smart-select to the jsFiddle and it works fine there…
Not sure what’s going on - I will investigate later.

Thanks for your help!

For some reasons (I have no clues why), I had the ‘moveElements’ property set to false in f7params:

f7params: {
    sortable: {
        moveElements: false,
      }
}

After setting it to true everything works like a charme!

So: sorry for the spam! :/:roll_eyes:

1 Like