Sortable: Doesn't work with tables.

Created on 14 Mar 2017  路  7Comments  路  Source: SortableJS/Sortable

The script work well with lists.
But less well when there is a margin between items
And doesn't work with with tables
http://codepen.io/paganaye/pen/WpEGmG

Most helpful comment

@paganaye it does work, it's just not the most elegant thing. table borders remain in place, but the rows themselves can be dragged around.

I forked your code: http://codepen.io/jlapinski/pen/gmZQBg

I really haven't looked into this much, but I believe if you want your <tr> to be draggable, you must init with Sortable.create with the <tr>'s immediate parent, <tbody>

All 7 comments

Seem <div> can stand alone but <tr> should be wrapped by <table>. You can refer flex box to display dive as table.

@paganaye it does work, it's just not the most elegant thing. table borders remain in place, but the rows themselves can be dragged around.

I forked your code: http://codepen.io/jlapinski/pen/gmZQBg

I really haven't looked into this much, but I believe if you want your <tr> to be draggable, you must init with Sortable.create with the <tr>'s immediate parent, <tbody>

I am happy with ainJoshinya response and am closing this request.

While using Sortable on the tbody works fine in Safari (10.0.1, macOS Sierra), I'm having issues where nested (inside the td) <img> and <input> elements disappear from the dragged item. In fact, the background disappears (it's fully transparent), unlike Chrome, which behaves as expected.

This can be observed in the example @aintJoshinya gave as well: http://codepen.io/jlapinski/pen/gmZQBg (input disappears, no green background)

cc @RubaXa could this be a race-condition, where the dragClass is not applied in time for the 'snapshot' (image) to be constructed by Safari?

I'm experiencing the same issue as described by @fabien. The dragClass is not applied in Safari (background stays fully transparent)

I'm experiencing the same [roblem as @mitomm i.e. transparent background on dragged row.

@thelucid It seems to be working for me in MacOS Mojave w/ Safari 12.
Are you using the latest version of Sortable (1.8.3)?

1062

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dwburdick picture dwburdick  路  3Comments

binitghetiya picture binitghetiya  路  4Comments

irfanlone picture irfanlone  路  3Comments

benfoster picture benfoster  路  3Comments

seltix5 picture seltix5  路  3Comments