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

Reduce amount of scroll listeners in the header #4801

Open
alizedebray opened this issue Feb 26, 2025 · 0 comments
Open

Reduce amount of scroll listeners in the header #4801

alizedebray opened this issue Feb 26, 2025 · 0 comments
Labels
📦 components Related to the @swisspost/design-system-components package Header Everything related to our composible header components

Comments

@alizedebray
Copy link
Contributor

          Because if the scrollParent is the <html/> element, the this.scrollParent listener is not working and vice versa.

Binding both listeners, ensures, we can always call this.handleScrollEvent, no matter which element is the scroll parent. And the other listener will just not being called.

Originally posted by @oliverschuerch in #4786 (comment)


The headers is currently adding listeners to both its scroll parent and the window, check if we can set one or the other instead of both

@alizedebray alizedebray added 📦 components Related to the @swisspost/design-system-components package Header Everything related to our composible header components labels Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 components Related to the @swisspost/design-system-components package Header Everything related to our composible header components
Projects
Status: 👀 Triage
Development

No branches or pull requests

1 participant