Aurelia 2 with Dragula

I’m posting this here as the comment system seems to be broken on the original article https://mobilemancer.com/2020/09/21/using-dragula-with-aurelia-2-and-typescript/

While it’s cool that Dragula just works, I would like to see a real world scenario. The example is far too simple. I would love to see how easy it would be to have an array of draggable items on the view model be updated when the drag occurs. Re-arranging items in a list box would be common use.

More advance would be moving items from 1 list box to another

1 Like

As with most of these libs you get all sorts of events. E.g starting a drag, dropping an Item etc. So from there just pick the idx and re-arrange your models in your array. Wrappers generally handle that specific part like the Aurelia dragula wrapper for v1.

1 Like

I understand, but the example as it stands is kind of silly IMO

1 Like

Well silly is a hard word but granted its a very basic scenario :wink:

1 Like

I am going to migrate bcx-aurelia-reorderable-repeat from Aurelia 1 to Aurelia 2.

4 Likes

I too would recommend bcx-aurelia-dnd/ bcx-aurelia-reorderable-repeat.

We migrated to that from dragula a couple of years ago and it is far superior in an Aurelia context.

3 Likes