mercs600 / vue2-perfect-scrollbar

Vue.js wrapper for perfect scrollbar
https://mercs600.github.io/vue2-perfect-scrollbar/
MIT License
275 stars 43 forks source link

Propagation not stopped #4

Closed njordr closed 5 years ago

njordr commented 5 years ago

Hi.

This is my setup:

import PerfectScrollbar from 'vue2-perfect-scrollbar'
import 'vue2-perfect-scrollbar/dist/vue2-perfect-scrollbar.css'

Vue.use(PerfectScrollbar, {
  wheelPropagation: false
})

Both in firefox and chrome when I reach the bottom or the head of the div, the scroll is propagated to the parent.

This is from firefox inspector

function(e) {
  var positionTop =
    e.pageY -
    window.pageYOffset -
    i.scrollbarYRail.getBoundingClientRect().top;
  var direction = positionTop > i.scrollbarYTop ? 1 : -1;

  i.element.scrollTop += direction * i.containerHeight;
  updateGeometry(i);

  e.stopPropagation();
}
mercs600 commented 5 years ago

Hi @njordr, please pass your perfect scrollbar settings as options object to install method.

Vue.use(PerfectScrollbar, {
 options: {
  wheelPropagation: false
 }
})

https://github.com/mercs600/vue2-perfect-scrollbar#options-object-options

njordr commented 5 years ago

Thanks for spotting it, it works now!