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

Infinite loop if popper is an unmounted element #1128

Closed
AlbertLucianto opened this issue Jun 9, 2020 · 1 comment · Fixed by #1129
Closed

Infinite loop if popper is an unmounted element #1128

AlbertLucianto opened this issue Jun 9, 2020 · 1 comment · Fixed by #1129
Labels
bug Something is not working. NEEDS: triage

Comments

@AlbertLucianto
Copy link

CodeSandbox demo

https://codesandbox.io/s/adoring-meadow-jq7i8

Steps to reproduce the problem

  1. Create an element that's not mounted
  2. Set it as popper element

What is the expected behavior?

Does nothing (before v2.4.1), or maybe a warning can be given.

What went wrong?

Stuck in infinite loop.

Any other comments?

I have checked and I think the code causing the problem is in these lines. When an unmounted element is given to getParentNode(el) it returns the root html. Then when html element is given to isHTMLElement(el) it will be false and cause infinite loop.

I used react-popper, and I think it's not uncommon to have popper element that suddenly gets unmounted.

Doesn't have the problem in v2.4.0.

@AlbertLucianto AlbertLucianto added bug Something is not working. NEEDS: triage labels Jun 9, 2020
@rijkvanzanten
Copy link

I can confirm I'm seeing the same behavior on my end in a Vue based application

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working. NEEDS: triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants