Answer the question
In order to leave comments, you need to log in
Jquery-Ui Sortable - sorts the list but doesn't scroll the page on iPad. How to make scrolling and sorting through delay?
I have a list in a sidebar and I apply "jQuery Ui Sortable" to it. for sorting goods.
https://api.jqueryui.com/sortable/
When I try to scroll a list on my iPad by swiping the screen and it hits a list item, instead of scrolling it starts dragging the item, the list sorts but fails to scroll.
I think there is an option in jQuery.sortable to control this. In the parameters somewhere:
$('.target-list').sortable({
delay: 500,
scroll: true,
...
// сортируем тут если после задержки если по тачу delay > 500, или скролим если задержка не дождалась 500,
// т.е. свайп обычный должен отрабатывать
})
$('.target-list').sortable({
delay: 500,
scroll: true,
items: '.unit',
stop: function (e, ui) {
$.post('/some_sourse/reorder', {
order: $('.target-list .unit').map(function (i, el) {
return $(el).data('id');
}).toArray()
});
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question