Skip to content

Feature Request: Support for ng2-dragula #22

@lcecil

Description

@lcecil

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:

  1. 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.
  2. 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 with ng2-dragula. Not sure this would solve my problem with the keyboard events though.
  3. Other?

Please let me know if there is something I'm missing or any other ideas you may have.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions