Horizontal scrolling using angularjs-dragula

I am using angularjs-dragula and I cannot automatically scroll overflow container which is hidden from the screen.

This is my problem:
I have five containers in my dragul, and the fifth container is hidden from the screen. Now I want to drag an item from the first container and put it in the 5th container. But I can not do this, since the screen does not automatically scroll to the 5th container.

Does angular-dragula support vertical scrolling? or is there a property that i am missing?

Plunkr example: https://plnkr.co/edit/iD38MugmHIx298p7OlrI?p=preview

var app = angular.module('angular-dragula-demo', [angularDragula(angular)]);
app.controller('MainCtrl', function($scope, dragulaService) {
    dragulaService.options($scope, 'fifth-bag', {
        copy: true
    });
});
+4
source share
1 answer

, Dragula. Dragula dom-autoscroller.

. Github: https://github.com/bevacqua/dragula/issues/121

AngularJS:

1) dom-autoscroller : https://github.com/hollowdoor/dom_autoscroller/blob/master/dist/dom-autoscroller.min.js

2)

3) :

// ENABLE AUTOSCROLL FOR GOALS LIST
var scroll = autoScroll([
    document.querySelector('.list')
], {
    margin: 30,
    maxSpeed: 10,
    scrollWhenOutside: true,
    autoScroll: function () {
        //Only scroll when the pointer is down
        return this.down
    }
});
+1

Source: https://habr.com/ru/post/1670372/


All Articles