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(utils): Checking if parent.contains is a function before using it #492

Conversation

arthurdenner
Copy link
Contributor

What:
Closes #490.

Why:
Because when using styled-components, the parent parameter in isOrContainsNode is a SC wrapper that doesn't contain a .contains function.

How:
Checking if parent.contains is a function before using it.

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

I'm not sure if that's the only necessary change, but testing locally, this was enough to avoid the problem. Let me know if anything else needs to be done or added. 👍

Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kentcdodds kentcdodds merged commit b9068a1 into downshift-js:master Jun 28, 2018
@arthurdenner arthurdenner deleted the fix/checking-parent-contains-before-using-it branch June 28, 2018 19:24
@kentcdodds
Copy link
Member

🎉 This PR is included in version 2.0.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

Rendez pushed a commit to Rendez/downshift that referenced this pull request Sep 30, 2018
…downshift-js#492)

* fix(utils): Checking if parent.contains is a function before using it

Closes downshift-js#490

* chore: Adding myself as a contributor
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.

parent.contains is not a function when used with styled components
2 participants