Opened 12 years ago

Closed 12 years ago

#2926 closed bug (fixed)

Sortable Fails to sort to last position

Reported by: malfist Owned by: paul
Priority: major Milestone: 1.5
Component: ui.sortable Version:
Keywords: div, last position Cc:
Blocked by: Blocking:

Description

When using a DIV tag inside an unordered list with sorting inabled, if the list item being dragged/sorted has more div's than the last element, it can not be placed as the last element.

Example:

<ul id='sort'>
		<li><div>1</div><div><br />&nbsp;2</div></li>
		<li><div>2</div></li>
		<li><div>3</div></li>
		<li><div>4</div></li>
	</ul>
</div>
<script type='text/javascript'>
	$("#sort").sortable({ items: "li", revert: true});
</script>}}}

While in the drag fuction(e) of jquery.ui.sortable the for loop that determines if an item has been moved reports a strange behavior with the index when compared to that of a normal list item. 
I have the personalized jquery.ui with everything in it and this for loop is at line 2519 and the if statements that determine if an element has been moved is 10 lines below that.

Change History (2)

comment:1 Changed 12 years ago by malfist

Sorry, that did not format properly:

<ul id='sort'>
		<li><div>1</div><div><br />&nbsp;2</div></li>
		<li><div>2</div></li>
		<li><div>3</div></li>
		<li><div>4</div></li>
	</ul>
</div>
<script type='text/javascript'>
	$("#sort").sortable({ items: "li", revert: true});
</script>

While in the drag fuction(e) of jquery.ui.sortable the for loop that determines if an item has been moved reports a strange behavior with the index when compared to that of a normal list item. I have the personalized jquery.ui with everything in it and this for loop is at line 2519 and the if statements that determine if an element has been moved is 10 lines below that.

comment:2 Changed 12 years ago by paul

Resolution: fixed
Status: newclosed

This has been fixed in the newest version. The error causing it is the tolerance mode, which is now default at "guess".

Note: See TracTickets for help on using tickets.