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

Accordion: Mutation observer is not removed #980

Closed
w33ble opened this issue Jul 9, 2018 · 1 comment
Closed

Accordion: Mutation observer is not removed #980

w33ble opened this issue Jul 9, 2018 · 1 comment

Comments

@w33ble
Copy link
Contributor

w33ble commented Jul 9, 2018

See https://github.com/elastic/eui/blob/master/src/components/accordion/accordion.js#L67-L70

A mutation observer is created when the Accordion renders, but it is never removed. When the component unmounts, setChildContentHeight can still be called, and would result in an error:

It's not clear from the MDN docs, but this could also result in a memory leak if the listener isn't automatically cleaned when the DOM node is removed.

@w33ble
Copy link
Contributor Author

w33ble commented Jul 9, 2018

This is a non-issue. The ref function is called with null, which effectively removes the observer without creating a new one. Sorry for the noise.

@w33ble w33ble closed this as completed Jul 9, 2018
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

No branches or pull requests

2 participants