mdbootstrap / perfect-scrollbar

Minimalistic but perfect custom scrollbar plugin. Get more free components with Material Design for Bootstrap UI Kit (link below)
https://perfectscrollbar.com/
MIT License
346 stars 66 forks source link

`scrollIntoView` scrolls the whole page instead of just the scrollable area #4

Open jan-molak opened 2 years ago

jan-molak commented 2 years ago

Hi there,

It looks like when invoking scrollIntoView on an element inside the scrollable area the whole page is being scrolled, not just the scrollable area itself.

This issue affects test automation frameworks (such as Serenity/JS https://github.com/serenity-js/serenity-js/issues/1104) trying to interact with Perfect Scrollbar.

JSFiddle reproducing the issue: https://jsfiddle.net/L7vfqa9x/

Recording:

https://user-images.githubusercontent.com/1089173/151190274-9e7898cd-e643-47db-8a06-733600e1779a.mp4

ajitjadhav28 commented 1 year ago

Did anyone found any work-around ? I am facing same issue!

AXLWeb commented 1 year ago

Did anyone found any work-around ? I am facing same issue!

As for the fiddle above I prevent whole page scroll by just passing an object with desired behaviour parameters as documentation says.

{ behavior: 'smooth', block: 'center', inline: 'center', }