Skip to content

"Placeholder" #591

Closed
Closed

Description

@knospe-

Hello,

I have a question regarding "placeholders". Do I have to set some sort of group attribute to enable that the group has a placeholder in case all the items are removed from this group?
I'm using elements of one table as a group and "tr"s as group elements.

For example if I have two groups, A and B, and I can move items from one group to another. And if I move all items from group A to B, (group A is now empty) but than decide to move some items back from B to A, I cannot do this anymore. It is like that group A is not active anymore.

I've created a JSFiddle that demonstrates this:
http://jsfiddle.net/knospe/aqgfnx2b/2/

When you move the element from "EUR Warenkorb" to "Bonuspunkte Warenkorb" you cannot add anything back to "EUR Warenkorb".

My solution for this would be adding a placeholder element, when the list is empty (-> checkSortableCart function). But then I have a problem that also this placeholder element should be of class .items and so it also could be moved to another list.
I have noticed the same behaviour by the first example (List A, List B) at http://rubaxa.github.io/Sortable/

For some reason do groups in the second example "Multi" accept items after all the items have been removed from them.

Could anyone please explain to me why the difference in behaviour of groups?

Activity

  1. RubaXa commented on Oct 7, 2015

    @RubaXa
    Collaborator

    Use min-height or min-width + :empty-selector.

  2. knospe- commented on Oct 8, 2015

    @knospe-
    Author

    Tnx for the hint. However this is only possible, when an array's tbody is displayed as block. This changes a behaviour of the table. Is there any other possible solution that lets table be displayed as table?

    I have updated my JSFiddle
    http://jsfiddle.net/knospe/aqgfnx2b/4/

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