goldenyz / react-perfect-scrollbar

A react wrapper for perfect-scrollbar
MIT License
480 stars 91 forks source link

Unnecessary & incorrect scrollbars initially visible #154

Open ChambreNoire opened 2 years ago

ChambreNoire commented 2 years ago

Hi,

I have a strange problem. I'm using the react-perfect-scrollbar within the body of an AntD modal window.

Occasionally, as soon as the modal is shown, the body div is decorated with scrollbars despite the content fitting easily within the div. As soon as I click on the scrollbars or move the mouse wheel, they disappear. What's more, these scrollbars are incorrectly sized for the div. For a 600x400 div, the scrollbars take up 120 and 80 pixels respectively (that's the length of the whole scrollbar, not just the scrollable "handle" part).

Any idea what could cause this?

I tried to extract this to a sandbox project but, despite featuring all the same code, the bug does not happen here. Nevertheless, I include the project here in the hopes that, if this problem is caused by my use of RPS, this is visible here.

https://stackblitz.com/edit/react-g4ugrl?file=src%2FBaseModal.js

Thanks!