Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

When unmounting, call uninstall in addition to removeAllListeners #15

Merged
merged 2 commits into from
Sep 27, 2016

Conversation

Philipp91
Copy link
Contributor

If uninstall isn't called, and I use elements like material-ui's FlatButtons in the Measure element (instead of just

s), I get errors like this one:

Uncaught TypeError: Cannot read property 'appendChild' of null
getCloneDimensions @ get-clone-dimensions.js:39
getNodeDimensions @ get-node-dimensions.js:22
getDimensions @ Measure.js:118
Measure.measure @ Measure.js:56
(anonymous function) @ Measure.js:92
addListener @ element-resize-detector.js:161
onElementDetectable @ element-resize-detector.js:236
ready @ scroll.js:561
process @ batch-processor.js:124
processBatch @ batch-processor.js:37

which indicates that an event on a node was fired, whose parent node is gone. This happens after a Measure element is removed (e.g. because a list item was removed).

@souporserious
Copy link
Owner

Awesome, thank you for this! I noticed that error the other day and hadn't had a chance to look at it yet.

@souporserious souporserious merged commit 8cf5f43 into souporserious:master Sep 27, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants