dequelabs / react-axe

[DEPRECATED] Accessibility auditing for React.js applications
Other
1.16k stars 45 forks source link

Fix premature unmount bug #104

Closed jpasquers closed 5 years ago

jpasquers commented 5 years ago

<< Describe the changes >>

Closes issue: https://github.com/dequelabs/react-axe/issues/103

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.

AutoSponge commented 5 years ago

@jpasquers given the error, I think it's best to filter getCommonParent argument by isConnected.

Can you see if this change also avoids the issue?

ln:126 index.js

- var n = getCommonParent(nodes);
+ var n = getCommonParent(nodes.filter(node => node.isConnected));
jpasquers commented 5 years ago

Yes, that also solved the error. I updated with a new commit, only change I made was using function over arrow syntax because I'm not sure about what backwards compatibility requirements there are.

rwschmitz commented 5 years ago

Thanks, this helps my team out a lot.