angular-ui/ui-sortable

Broken Drag with Handle on Safari 11.0.3

BitForger opened this issue · 4 comments

I'm currently running into an issue with the ui sortable directive. When I click an hold on a handle in safari to move the section of the page it starts scrolling the page down on safari and it won't let me move it up.
large gif 1346x562

Oh, I hate weird Safari issues...
I would suggest you to try using the placeholder or the helper options to fill in the gap or use a smaller element while dragging (respectively).
Seems related to #495 #286 #109 , please check the discussion in there as well.

PS: I'm not a mac user, so someone else might have better ideas

@thgreasi Are there docs for the placeholder and helper options? I don't see them
I see it now, in jquery UI docs

Here is the snippet of the options that remedied the situation for me

'ui-floating': true,
      start: function(e, ui) {
        $('.promo-list').sortable({
          sort: function(event, ui) {
            var $target = $(event.target);
            if (!/html|body/i.test($target.offsetParent()[0].tagName)) {
              var top = event.pageY - $target.offsetParent().offset().top - (ui.helper.outerHeight(true) / 2);
              ui.helper.css({'top' : top + 'px'});
            }
          }
        });

      },
      update: function(e, ui) {
        if (ui.item.sortable.model.idVideo == -1) {
          ui.item.sortable.cancel();
        }
      },
      scroll: false,

Thanks for sharing back to the community @BitForger 👍