Skip to content

Add class to target list when about to drop a dragged item #1269

Open

Description

@stevenaanen

Thanks for the great plugin!

I have 2 lists, A and B. Sorting is disabled within each list, since I order the items alphabetically. So I use the Sortable plugin specifically to drag items between lists. Disabling the sort option within a list works fine, but when dragging an item from list A to list B, it's suddenly possible to choose where the item will land (index within list B). This is not what I want, because the order within one list is determined programatically (alphabetical order).

My thought was: let's change the style of a target list in such a way, that it is not visible on which position the item will land exactly. So for instance, when dragging an item and hovering over a target list, make the entire list a big empty space with a PLUS sign. That shouldn't be to hard with some css, except... there's no way to figure out that an item is being dragged over a target list.

My suggestion: add a class (just like ghostClass or chosenClass) for a target list over which we're about to drop an item. Should be possible since there are also events firing when this happens. This would enable to do cool things visually with the list on which you're about to drop an item. Could be named targetListClass or so.

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