-
Notifications
You must be signed in to change notification settings - Fork 26
Description
I'm working on an project that uses Angular 6 and would like to use this library for the keyboard interactions, and the Angular 2 bridge for dragula for the mouse interactions (ie. ng2-dragula
).
In my project, I have a list of items that are sorted by a position
property. When you re-order the items on the list, via dragging an item with the mouse or keyboard, the position
property for all the items in the array is updated.
ng2-dragula
has a new event available in the service called dropModel
; an observable that sends over a few properties, most notably the targetModel
, so I can easily update the positions of each item in the array. This takes care of the above paragraph for mouse interactions.
However, I'm struggling a bit when using this library to figure out how to do this for the keyboard interactions. I have some ideas for features that could make this easier:
- Include the array of items in the
.on('dropped')
callback function, so that there's some way to determine new positions with the dropped item. - Add a property to the options object that lets you pass in the dragula/drake instance created with
ng2-dragula
. As it stands now, I think I'm creating two - one with your lib, and one withng2-dragula
. Not sure this would solve my problem with the keyboard events though. - Other?
Please let me know if there is something I'm missing or any other ideas you may have.