Skip to main content

Search and Top Navigation

#4765 closed bug (fixed)

Opened August 10, 2009 12:36PM UTC

Closed February 21, 2013 01:16AM UTC

Last modified February 21, 2013 01:16AM UTC

Sortable: Placeholder not displayed when sorting table rows

Reported by: soulhunter Owned by:
Priority: major Milestone: 1.10.2
Component: ui.sortable Version: 1.7.2
Keywords: sortable table tr safari chrome Cc:
Blocked by: Blocking:
Description

When applying sortable() to a table ($('tbody').sortable()) and trying to sort rows in Google Chrome or Safari (based on the same rendering engine) - the placeholder is not shown, so the affect of row replacing doesn't occure. This happens because the empry <tr/>'s are not displayed. As i think table rows sorting is a frequent task so it would ge good to fix it. I just canged the code in _createPlaceholder() so that if sorting item is tr - it appends an empty <td/> to it and set's the size (width and height, most often it is only height) of this <td/> instead of <tr/>. This method works in Chrome, Safari, Firefox and Opera. IE wasn't tested.

Attachments (1)
Change History (10)

Changed August 11, 2009 05:37PM UTC by scottgonzalez comment:1

component: ui.coreui.sortable
milestone: TBD1.8

Changed November 09, 2009 02:23PM UTC by tony@trirand.com comment:2

Hello,

I can confirm this bug.

Moreover I see the following behavior in Chrome (Same in Safari).

When we have a table-layout set to fixed for the table, after sorting a table row, the row have all the attributes of the helper - i.e the position:absolute and etc. - whit other words resting does not apply correct.

Changed December 31, 2009 06:27AM UTC by phloopy comment:3

I attached a patch file that fixes this issue (tested in Chrome 3.0.195.33, Firefox 3.5.6, Safari 4.0.4 (531.21.10), and IE 8.0.7600.16385). I'm not able to understand the problem Tony describes, so that has not been addressed.

Changed April 27, 2011 03:36PM UTC by whittet@gmail.com comment:4

_comment0: This is still a but in 1.8.12 per my test case using Google Chrome: \ \ Demo problem: http://jsfiddle.net/whittet/P2yuG/ \ \ Webkit Use case: \ A) drag the "1" to the right column and drop it \ BUG: "1" should display above either cell in the second row! Definitely not outside the table.1303918724712024

This is still a bug in version 1.8.12.

Demo problem: http://jsfiddle.net/whittet/P2yuG/

Use case:

A) drag the "1" to the right column and drop it

B) "1" should display above either cell in the second row! Definitely not outside the table.

Note a patch is attached. Does anyone have time to review the change? Why hasn't this been done already? The code is here, does it need to be in a pull request?

Changed October 11, 2012 02:54PM UTC by scottgonzalez comment:5

milestone: 1.9.02.0.0

Changed October 25, 2012 02:37PM UTC by petersendidit comment:6

status: newopen

Changed February 20, 2013 03:36AM UTC by tj.vantoll comment:7

summary: table sortable AppleWebkit bugSortable: Placeholder not displayed when sorting table rows

Test case: http://jsfiddle.net/tj_vantoll/aDaVJ/. This issue occurs in all browsers.

Changed February 20, 2013 04:31AM UTC by scottgonzalez comment:8

The proposed fix is much larger than something I'd like to see in the plugin. The problem comes from the fact that empty table rows don't have any content to show. Here's a workaround using the ghetto, undocumented, placeholder API: http://jsfiddle.net/aDaVJ/3/

Changed February 21, 2013 01:16AM UTC by Scott González comment:9

resolution: → fixed
status: openclosed

Sortable: When sorting table rows, create a td to force dimensions. Fixes #4765 - Sortable: Placeholder not displayed when sorting table rows.

Changeset: bd47bd4ace3789d9eb302b0dce6f6e042d08a7f1

Changed February 21, 2013 01:16AM UTC by scottgonzalez comment:10

milestone: 2.0.01.10.2