Skip to content

Add classes on dragover - #991

Closed
valentinvoilean wants to merge 3 commits into
SortableJS:masterfrom
valentinvoilean:master
Closed

valentinvoilean wants to merge 3 commits into
SortableJS:masterfrom
valentinvoilean:master

Conversation

@valentinvoilean

@valentinvoilean valentinvoilean commented Nov 9, 2016 •

Copy link
Copy Markdown

Use these options to add classes for valid & invalid groups.

sortableOptions = {
        group: {
            name: 'qux',
            put: function (to) {
                return to.el.children.length < 4;
            }
        },
        validGroupClass: 'myValidCLass', // default is "sortable-valid"
        invalidGroupClass: 'myInvalidClass', // default is "'sortable-invalid'
    };

Also, in order to make it work with react, I had to apply this fix too (which was declined before):
#984
If I don't use that fix, the item disappears after is dropped.

- took out the dragOver event;
- added the "pointer-events" css property ( IE >= 11 )
- improved the dragLeave event to not be called on children (IE < 11)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant