Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS: page y offset and custom scrollbar issue #49

Open
ThaUnknown opened this issue Sep 22, 2020 · 6 comments
Open

JS: page y offset and custom scrollbar issue #49

ThaUnknown opened this issue Sep 22, 2020 · 6 comments
Labels
v1 Version 1.x.x

Comments

@ThaUnknown
Copy link

ThaUnknown commented Sep 22, 2020

by default, the entire page is displayed in position absolute [html, body, page-wrapper], I'm guessing this was done in order to have a nicer display for scrollbars? this causes many issues with js like:

window.onscroll
window.pageYOffset
window.innerHeight

this can be worked around manually however it causes issues for existing scrollspy JS libraries, one solution could be to remove the position absolute and move the

 class="with-custom-webkit-scrollbars with-custom-css-scrollbars"

to the HTML tag instead of body and removing height and position from the .content-wrapper, body, html selectors, this would mostly solve the issue and remove the hacky workaround without majorly breaking anything

@ThaUnknown
Copy link
Author

ThaUnknown commented Sep 22, 2020

this also fixes trying to scroll to the top of the page with

<a href="#"></a>

@halfmoonui
Copy link
Owner

Thanks a lot for bringing this up, and also suggesting the fixes. I think this will require some extensive cross-browser testing, because getting the scrolling right is obviously very important. I will report any possible issues I find on this thread.

However, if your fixes work as expected, I will quickly patch this and push out a new release as soon as possible.

@ThaUnknown
Copy link
Author

Thanks a lot for bringing this up, and also suggesting the fixes. I think this will require some extensive cross-browser testing, because getting the scrolling right is obviously very important. I will report any possible issues I find on this thread.

However, if your fixes work as expected, I will quickly patch this and push out a new release as soon as possible.

forgot to mention, you'd also need to remove position absolute and height from .page-wrapper

@ThaUnknown
Copy link
Author

@halfmoonui please look at this, it causes significant scrolling performance issues on heavy sites, you can easily observe this by enabling scrolling performance issues in rendering tab of chrome dev tools

@brayanduranvelasquez
Copy link

No se si estoy equivocado, ¿pero aun no se ha solucionado el problema del evento scroll? estoy intentando poder capturar con el evento scroll pero no me lo permite.

@ThaUnknown
Copy link
Author

No habla español

half-moon is dead, I made my own fork which fixed this and more bugs half-moon has, see: https://github.com/ThaUnknown/quartermoon

@halfmoonui halfmoonui added the v1 Version 1.x.x label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v1 Version 1.x.x
Projects
None yet
Development

No branches or pull requests

3 participants