jQuery sortable item height

后端 未结 3 1315
灰色年华
灰色年华 2021-02-04 14:25

I\'ve got a simple jQuery sortable based on a list as follows:

  • Item 1
  • Item 2
  • Item 3
3条回答
  •  有刺的猬
    2021-02-04 15:14

    After much hair-tearing I added this event to the sortable:

      start: function( event, ui ) {
        $( this ).sortable( 'refreshPositions' )
      },
    

    It seems to do the trick as I think start() is called after the helper has been created, so refreshing the positions resets the height. Probably jQuery should do this itself, but for now I'm happy.

提交回复
热议问题