Skip to main content

Bug Tracker

Side navigation

#3661 closed bug (invalid)

Opened November 28, 2008 07:08PM UTC

Closed November 28, 2008 09:43PM UTC

Last modified March 14, 2012 11:15PM UTC

ui/sortable(): dragged element has incorrect position due to body-margin

Reported by: O'RLY Owned by: flesler
Priority: major Milestone: 1.3
Component: unfiled Version: 1.2.6
Keywords: Cc: O'RLY
Blocked by: Blocking:
Description

jquery-ui/sortable()

Happens both in IE and Firefox

When i start dragging the DIV element on the page with nonzero body margin, the dragging helper object displays with a top&left offset from its original position which creates an unpleasant "jumping" effect.

Seems like this is caused by the incorrect calculation of helper object position which starts offset summation from document edge ignoring the body margins. This causes the helper object to jump from it's original position by the distance equal to respective body margins.

Sample code to reproduce:

NOTE: Body margin must have non-zero values


<div class="dragContainer" style="height: 200px; width: 800px; background-color: Red;">

<div class="dragDiv" style="height: 20px;width: 500px;background-color:Yellow; border:solid 1px green"></div>

<div class="dragDiv" style="height: 20px;width: 500px;background-color:Yellow; border:solid 1px green"></div>

<div class="dragDiv" style="height: 20px;width: 500px;background-color:Yellow; border:solid 1px green"></div>

<div class="dragDiv" style="height: 20px;width: 500px;background-color:Yellow; border:solid 1px green"></div>

<div class="dragDiv" style="height: 20px;width: 500px;background-color:Yellow; border:solid 1px green"></div>

<div class="dragDiv" style="height: 20px;width: 500px;background-color:Yellow; border:solid 1px green"></div>

<div class="dragDiv" style="height: 20px;width: 500px;background-color:Yellow; border:solid 1px green"></div>

</div>

<script type="text/javascript">

$(".dragContainer").sortable({

distance: 1,

axis: "y"

});

</script>

Attachments (0)
Change History (1)

Changed November 28, 2008 09:43PM UTC by flesler comment:1

cc: → O'RLY
resolution: → invalid
status: newclosed

This belongs to the UI Bug Tracker.