How to debug a jQuery nested sortable draggable element?

前端 未结 3 1527
情歌与酒
情歌与酒 2021-02-09 07:06

The first part allows you to first drag an element into a sortable div, which is working fine. I then want to have that div become sortable as well so I can drag new elements (p

3条回答
  •  花落未央
    2021-02-09 07:26

    seems you've uncovered a bug in sortable... a potential workaround is to recreate the '.part-holder' sortable whenever it's re-ordered...

    $('.part-holder', ui.item).sortable('destroy');
    

    put that right above

    ...
    $('.part-holder', ui.item).sortable({ 
       ...
    

    it's a hack, but hey it works... :)

提交回复
热议问题