Skip to content

Error when calling node.contains because it is not a method #985

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

Closed
rolandpoulter opened this issue Mar 19, 2023 · 2 comments · Fixed by #988
Closed

Error when calling node.contains because it is not a method #985

rolandpoulter opened this issue Mar 19, 2023 · 2 comments · Fixed by #988
Labels

Comments

@rolandpoulter
Copy link

https://github.com/ReactTooltip/react-tooltip/blob/master/src/components/Tooltip/Tooltip.tsx#L377

When node is undefined or when contains is not a method this causes an uncaught exception.

Suggest changing the expression to:

node?.contains && node.contains(activeAnchor)

This will prevent errors from happening

@danielbarion
Copy link
Member

thanks for the report @rolandpoulter! PR created :)

@gabrieljablonski
Copy link
Member

Fixed on [email protected]. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants