Perfect-scrollbar: scroll down infinitely

Created on 12 Jun 2020  Â·  10Comments  Â·  Source: mdbootstrap/perfect-scrollbar

Perfect scrollbar parent is position:absolute,Scroll bar infinite scroll down,How can I solve it?

Most helpful comment

Is the reason:
The height of the scroll bar container is 592.7px,
Your div#ps__rail-y gets 593px,
Then the y-axis will scroll all the way down

All 10 comments

Is the reason:
The height of the scroll bar container is 592.7px,
Your div#ps__rail-y gets 593px,
Then the y-axis will scroll all the way down

After looking at the source code, I feel that it is a problem to obtain the width and height. It is this method:
i.containerWidth = Math.round(rect.width);
i.containerHeight = Math.round(rect.height);
Can you change it to this one? Math.floor()

Hi, they actually updated the code fixing this issue: Fix: scroll bar keeps scrolling down exceeding contents length

Pitifully, they didn't release yet a patch version including this fix :(

Hi
My container height is in viewport height, so it s render something like '531.4px'
I think this is why I have infinite scroll too.
Don't see working issue for this - Any idea to solve it ?

Actually I work on the height with javascript (set height - 1px as height of my container). This seem work but it's ugly hack.

I have the same problem in some condition. Any ideas? Thanks.
https://github.com/mdbootstrap/perfect-scrollbar/issues/974

They have the fix for this but not in the latest release and it seems that the project is not maintained anymore. I switched to https://github.com/Grsmto/simplebar and it works better and it's purely CSS so I'm happy to switch to it.

@Jokerwin I got it. I fixed it by changed this two lines of code.

  i.containerWidth = Math.round(rect.width);
  i.containerHeight = Math.round(rect.height);
  // i.containerWidth = Math.ceil(rect.width);
  // i.containerHeight = Math.ceil(rect.height);

Whose in charge here? Could I make a pr to fix this?

@EtnasSoft @utatti Thanks

@Jokerwin This is already fixed by me here https://github.com/mdbootstrap/perfect-scrollbar/commit/daeeddf5972c44a960f1d244a4b9719cb7c3d0b7.
This fix is merged to project. But they didn't released new stable version with this fix. Don't know why :(

News?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chavishindler picture chavishindler  Â·  3Comments

DevTony picture DevTony  Â·  3Comments

gpluess picture gpluess  Â·  4Comments

hyperknot picture hyperknot  Â·  7Comments

yabikusensei picture yabikusensei  Â·  3Comments