Despite the jQuery sortable widget
functioning well in most situations, there is a glitch when dealing with an ordered list
. Specifically, the
numbering becomes jumbled up during element dragging
. An example program is provided below to demonstrate this issue:
<!DOCTYPE html>
<html>
<head>
<script src="jquery-1.6.2.min.js"></script>
<script src="jquery-ui-1.8.16.custom.min.js"></script>
<script>
$(document).ready(function () {
$('ol').sortable();
});
</script>
</head>
<body>
<ol>
<li>
<label for="name">Name</label>
<input type="text" id="name" />
</li>
<li>
<label for="class">Class</label>
<input type="text" id="class" />
</li>
</ol>
</body>
</html>
Pre-dragging :
While dragging :
The correct order is restored after the drag operation is completed. This known issue has yet to be resolved. Have any solutions been discovered?
Here is the fiddle link for reference