react-parallax
react-parallax copied to clipboard
White space due to translate3d y parameter not resetting to 0px when scrolling to top fast.
Describe the bug Same issue as #39 (Probably) A white space appears if I scroll fast using the scrollbar on the browser rather than using the mouse scroll. The area of whitespace seems to be proportional to the strength attribute of the Parallax.
To Reproduce This can be reproduced with the codesandbox demo. Scroll to the top using the browser scrollbar (fast) and sometimes the translate3d y parameter won't reset to 0px leaving some white space.
Expected behavior
No whites space when scrolling to top.
Currently I'm using a workaround to fix this by listening to scroll change and when it reaches to the top I reset the translate3d to
transform: translate3d(-50%, 0px, 0px)
Screenshots
Normal behavior:
With the issue:
hello, i've been struggling with this issue too. Scrolling too fast from bottom to top, ty from translate3D is not reset to the initial value. The issue still can be reproduced in the demo from above
Same problem here. I'm using a MacBook Pro M1. Tested on Google Chrome and Firefox. Both had the same bug.