Skip to main content

Search and Top Navigation

#13662 closed bug (fixed)

Opened July 16, 2015 01:03AM UTC

Closed October 04, 2016 07:22PM UTC

Last modified October 04, 2016 07:23PM UTC

Sortable: placeholder can be wrong height when sorting variable-height table rows

Reported by: kevincupp Owned by: scottgonzalez
Priority: minor Milestone: 1.12.2
Component: ui.sortable Version: 1.11.4
Keywords: Cc:
Blocked by: Blocking:
Description

In the latest jQuery UI (1.11.4), reproduced in latest Safari (8.0.7) and Firefox (39.0), if you have a table with rows of variable height, or the height is dependent on the contents of the row, the placeholder height doesn't match the height of the row being dragged. By default, for all other elements that don't have a height, Sortable will set the height of the placeholder to the height of the item being dragged, and this used to be the case for table rows up until about 1.10 because Sortable was altered to add empty <td> elements to its placeholder <tr> element, thus giving the row a default height no matter what, and the smallest height possible for a row with content.

But it doesn't just cause a design problem. If that was all, I could solve it by setting the height of the placeholder in the start hook or something. It's a bigger problem because the containment bounds are set based on the placeholder height, and if that height is incorrect or smaller than expected, you cannot drag the row as far down the table as you could otherwise.

Here is a jsfiddle, notice dragging the first row inserts a smaller placeholder:

http://jsfiddle.net/Ls30z1kb/

I have a pull request I'm going to submit to GitHub for a potential fix, submitting this ticket as a prerequisite.

Attachments (0)
Change History (2)

Changed October 04, 2016 07:22PM UTC by scottgonzalez comment:1

owner: → scottgonzalez
resolution: → fixed
status: newclosed

In [changeset:"87eab46a589031d781299937f95f22bf61b5ef27" 87eab46a]:

#!CommitTicketReference repository="" revision="87eab46a589031d781299937f95f22bf61b5ef27"
Sortable: Setting table row placeholder height to be same as sorted row

Fixes #13662
Closes gh-1578

Changed October 04, 2016 07:23PM UTC by scottgonzalez comment:2

milestone: none1.12.2