Bug Tracker

Opened 11 years ago

Closed 11 years ago

Last modified 8 years ago

#3661 closed bug (invalid)

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>

Change History (1)

comment:1 Changed 11 years ago by flesler

Cc: O'RLY added
Resolution: invalid
Status: newclosed

This belongs to the UI Bug Tracker.

Note: See TracTickets for help on using tickets.