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

fix window scroll handler leaks #643

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

hkhere
Copy link

@hkhere hkhere commented Nov 28, 2020

Related Issue

The window's scroll handler is not removed when a new scroll handler is to be installed.

This does not only leak handlers but also causes accumulated scroll handlers to be executed every time the scroll event is fired.

Your solution

remove current scroll handler when a new scroll handler is to be installed

@hkhere
Copy link
Author

hkhere commented Nov 28, 2020

This can be easily verified using getEventListeners(window) in devtools and examine the scroll property of the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant