Opened 13 years ago

Last modified 9 years ago

#4428 open bug

Sortable: Containment works only with elements of the same height

Reported by: mg Owned by:
Priority: major Milestone: 2.0.0
Component: ui.sortable Version: 1.7.1
Keywords: Cc: [email protected]
Blocked by: Blocking:

Description

When sorted elements differ in height many problems appear then trying to drop an element in correct place:

Most annoying is then trying to drop element to end of the list when approaching from below. in 90% of tries it drops above the last element instead of the list end.

Another problem is incorrect height of placeholder under IE7, but I think it has already been reported.

Attachments (1)

drop.png (26.9 KB) - added by mg 13 years ago.

Download all attachments as: .zip

Change History (13)

Changed 13 years ago by mg

Attachment: drop.png added

comment:1 Changed 13 years ago by mg

Another observation: showing the placeholder is calculated with the height of drag handler, not the entire dragged element.

That's problably the cause.

comment:2 Changed 13 years ago by mg

Live demo of the bug can be seen here:

http://nettuts.s3.amazonaws.com/127_iNETTUTS/demo/index.html

Try to drop an element at the bottom when approaching from below. Most of the times it won't be possible until we reach 3/4 of the last element or it will be place above the last element.

The demo shows also IE7 placeholder BUG - just try it in IE7.

comment:3 Changed 13 years ago by Jörn Zaefferer

Milestone: TBD1.7.2

comment:4 Changed 13 years ago by Jörn Zaefferer

Milestone: 1.7.21.8

comment:5 Changed 11 years ago by k_borchers

I believe I have fixed this bug here https://github.com/jquery/jquery-ui/pull/307. Does not have to do with different heights of elements but rather the way intersections with the sortables were being calculated.

Version 0, edited 11 years ago by k_borchers (next)

comment:6 Changed 10 years ago by Scott González

Milestone: 1.9.02.0.0

comment:7 Changed 10 years ago by petersendidit

Status: newopen
Summary: sortable works only with elements of the same heightSortable: works only with elements of the same height

comment:8 Changed 9 years ago by tj.vantoll

#8621 is a duplicate of this ticket.

comment:9 Changed 9 years ago by tj.vantoll

Test case against master from #8621 - http://jsfiddle.net/tj_vantoll/j4Avu/.

comment:10 Changed 9 years ago by tj.vantoll

Reduced the test case against master http://jsfiddle.net/tj_vantoll/j4Avu/1/. Basically all you need is to have sortables of different heights and containment: 'parent' to recreate the issue.

comment:11 Changed 9 years ago by tj.vantoll

Possibly a duplicate of #5772 because both have to due with not being able to reorder when using the containment option.

comment:12 Changed 9 years ago by tj.vantoll

Summary: Sortable: works only with elements of the same heightSortable: Containment works only with elements of the same height
Note: See TracTickets for help on using tickets.