javascript - Jquery UI sortable on scrolled webpage -
there seems problem jquery ui sortable plugin on scrolled webpage. i'm using reorder table rows (and move them 1 table another). when website scrolled, drag&drop bottom table top table doesn't behave correctly imho. dragged element's placeholder not inserted new table @ bottom position, rather few rows after it. it's 2, 3 rows above. until mouse cursor goes up, it's broken. mouse goes @ least 1 pixel down, gets repositioned , fixed.
this screenshot how works when page not scrolled (on left), , later same page when scrolled bit (right):
code straightforward:
$( ".sortable tbody" ).sortable({"axis": "y", "cursor": "move", 'tolerance': 'pointer', 'cursorat': { top: 20, left: 20 }, 'scroll': false, "connectwith": $('.sortable tbody'), "items" : 'tr:not(.nosort)' }); $('body').scrolltop(340);
jsfiddle
how can fix this? goal ensure behaves same if webpage not scrolled.
i playing whole day, tried possible parameters of jquery ui, tried digg source code, wasn't successful.
i paid hard cash find out bug is. bugfix one-liner.
- axis = floating ? "clientx" : "clienty"; + axis = floating ? "pagex" : "pagey";
i'm going attempt propagate fix jquery-ui sources.
update: took year change should accepted in jquery ui current.
Comments
Post a Comment