mcm-ham / dragsort

jQuery List DragSort
3 stars 1 forks source link

dragsort won't initialize if all lists are empty #14

Open mcm-ham opened 6 years ago

mcm-ham commented 6 years ago

I have 3 lists, initially empty, filled dynamically later. If I call $(list).dragsort({ dragSelector: '.item' }) when they are empty, nothing happens. However, if at least one of the is nonempty, all of them get initialized.

This is clearly a bug, either it should initialize either way (preferred) or only for nonempty lists. Happens in current firefox & chrome, not tested elsewhere.

For the, the workaround of creating the lists with a placeholder item, initializing and then deleting the item works.

This work item was migrated from CodePlex

CodePlex work item ID: '33484' Vote count: '1'

mcm-ham commented 6 years ago

[himdel@27/11/2012] Additional info:

I can actually make it intialize almost fine using$('.orderselect').dragsort({ itemSelector: '.option', dragSelector: '.option', placeHolderTemplate: '' })

But then, dropping doesn't work - the item returns where it was.

If I add$('.orderselect').dragsort({ itemSelector: '.option', dragSelector: '.option', placeHolderTemplate: '' })it works, but weird - an empty option appears while dragging, which I don't want.