Skip to content

fix window scroll handler leaks - #643

Open
hkhere wants to merge 1 commit into
michalsnik:nextfrom
hkhere:fix-handler-leaks
Open

fix window scroll handler leaks#643
hkhere wants to merge 1 commit into
michalsnik:nextfrom
hkhere:fix-handler-leaks

Conversation

@hkhere

@hkhere hkhere commented Nov 28, 2020

Copy link
Copy Markdown

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

hkhere commented Nov 28, 2020

Copy link
Copy Markdown
Author

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