BosNaufal / vue-scrollbar

The Simplest Scroll Area Component with custom scrollbar for Vue Js. https://bosnaufal.github.io/vue-scrollbar/
MIT License
117 stars 25 forks source link

Issue with long horizontal scroll #7

Closed pbelyaev closed 8 years ago

pbelyaev commented 8 years ago

Hello! When I was trying to use this component for a long horizontal scroll it didn't work. I realized what's wrong with that. Look at this method:

handleChangePosition(vScrollbar, orientation){
        // Convert Percentage to Pixel
        let next = vScrollbar / 100 * this.scrollAreaHeight
        if( orientation == 'vertical' ) this.normalizeVertical(next)
        if( orientation == 'horizontal' ) this.normalizeHorizontal(next)
}

I think next variable should have condition either and also using different scrollArea values. At least it works for me.

handleChangePosition(vScrollbar, orientation){
        // Convert Percentage to Pixel
        let next = vScrollbar / 100 * (orientation == 'vertical' ? this.scrollAreaHeight : this.scrollAreaWidth)
        if( orientation == 'vertical' ) this.normalizeVertical(next)
        if( orientation == 'horizontal' ) this.normalizeHorizontal(next)
}
pbelyaev commented 8 years ago

How to check the issue? Just try to create a wrapper div with any width but without any height limits so vertical scroll won't be showed. Then create a content div with 9000+ px width and try to render that.

BosNaufal commented 8 years ago

Hey @pbelyaev, Thank you so much for giving me an issue and giving me its solution at the same time! thanks! :grin: :+1: