donmbelembe / vue-dragscroll

A vue directive to make a scrollable element scroll by draging to the scroll direction
https://vue-dragscroll.clebinfosys.com/
MIT License
261 stars 32 forks source link

pass scroll when max reached #14

Closed smbdelse closed 6 years ago

smbdelse commented 6 years ago

Hi

It would be helpful if scroll were passed to container, or further to the body, when max scroll position were reached, especially during one axis dragging.

on scrollable object I've added binding, like one showed in examples:

v-on:dragscrollmove="scrollMove($event.detail.deltaX, $event.detail.deltaY)"

And wrote small function:

      scrollMove: function(x, y){
        if (Math.abs(x) < Math.abs(y)) {
          window.scrollBy(0, y);
        }
      },

Unfortunately it cannot be done with scroll y disabled at same time.

donmbelembe commented 6 years ago

I have made a update for this but it is not yet published. I have allowed both options, the developer can add a modifier to the directive in other to allow or disabled passing scroll But I have to decide first what should be the default behavior

donmbelembe commented 6 years ago

feature added use pass modifier in v1.7 commit 7ea91d43a4adf4732d9364f46ad42ead9f6cf4b0