-
Notifications
You must be signed in to change notification settings - Fork 0
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
Doesn't work for another container from body. #7
Comments
Hello. You are correct. The hiding header is right now limited to window scroll only. I will investigate how hard it will be to respect other scroll parents but I expect some challenges. I will test the code you suggested first. Thank you. |
Do you have by any chance a small example I can test the new feature on? I'm not exactly sure what you are trying to achive. Part of the |
https://stackblitz.com/edit/vitejs-vite-ky42v2wk |
Thank you very much. It is very helpful. Now I understand the problem better. |
Hello
I've faced one issue - if we don't put our header in body directly, but in some other container, which has it's own scroll, everything stops working. It is caused by that fact that we listen for window.scroll event and check for window scrollY
Changing
window.addEventListener('scroll', onScroll) to parent.addEventListener('scroll', onScroll)
and
const scrollTopPosition = window.scrollY to const scrollTopPosition = parent.scrollTop
fixed this issue.
What do You think about such improvement? Maybe You can add one more parameter, such as ScrollParent,which will be window by default?
The text was updated successfully, but these errors were encountered: