angular-ui / ui-sortable

jQuery UI Sortable for AngularJS
http://angular-ui.github.io/ui-sortable/
MIT License
1.26k stars 444 forks source link

Broken Drag with Handle on Safari 11.0.3 #548

Closed BitForger closed 6 years ago

BitForger commented 6 years ago

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

thgreasi commented 6 years ago

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

BitForger commented 6 years ago

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

BitForger commented 6 years ago

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,
thgreasi commented 6 years ago

Thanks for sharing back to the community @BitForger :+1: