Opened 4 years ago

Closed 3 years ago

#13880 closed bug (duplicate)

jQuery UI sortable - overlapping by 50% doesn't seem to work

Reported by: TomasM Owned by:
Priority: minor Milestone: none
Component: ui.sortable Version: 1.11.3
Keywords: Cc:
Blocked by: Blocking:

Description

A nice demo is at official website here: http://jqueryui.com/sortable/

I think that the tolerance option does not work as intended.

With tolerance: intersect, the item should overlap the other item by at least 50%.

I expect the elements to be swapped if one element overlaps the another by more than 50% of its height. But as you can see at the official demo page, if you drag the very first element at the very first pixels, you need to move the first element more than 150% (!!!!) of its height down in order for the plugin to detect reorder.

This is in my opinion very wrong bug. It should swap them if I only move the item 50% of its height. Am I missing something? Thank you

Change History (4)

comment:1 Changed 4 years ago by Scott González

Status: newopen

The behavior is definitely confusing, and the documentation is wrong, but I don't think we should change the behavior until the rewrite lands since it's a potentially breaking change for users. The actual behavior is based on the item size AND the pointer location within the item being dragged.

comment:2 Changed 4 years ago by Tom

This needs to get a higher priority. This is not user friendly.

comment:3 Changed 4 years ago by octavpo

The easy 'fix' should be at least to change the documentation to reflect the actual behavior, so at least developers know what to expect, and this could be done right away. So instead of 'The item overlaps the other item by at least 50%' it should say 'The mouse pointer overlaps the other item by at least 50%'. I think that's what it's really doing.

The bigger issue is that neither of the two tolerance values is very useful for sorting. I think when you sort items the pointer position shouldn't matter. The problem with pointer position is that if you have items of different sizes and you use containment: 'parent', it can be impossible to reorder the larger one over the smaller one when the smaller one is the first or the last item, depending on where you click on the larger one. What should rather matter is the edge of the dragged item vs the other one.

comment:4 Changed 3 years ago by Scott González

Resolution: duplicate
Status: openclosed

Duplicate of #9696.

Note: See TracTickets for help on using tickets.