-
-
Notifications
You must be signed in to change notification settings - Fork 229
.before
is not working
#1637
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
Comments
It does appear to be a bug indeed caused by having the wrong parent being used. The parent should be from the element that this is being called on rather than from the child node. It seems like an easy fix. I am not really sure why the child node parent is used as that seems like it would be wrong every time.
@capricorn86 lmk if you want a pr fix for this. |
Thank you for reporting @aralroca and thank you for the analysis @OlaviSau! 🙂 I have made a fix now in v16.2.5. The reason for why it didn't work is because of the change in v15 to use a proxy for |
@OlaviSau It is always nice with a contribution 🙂 |
When running the following test:
I encounter this error:
However, when running this code in a real browser environment, it works as expected. It seems that happy-DOM does not fully support
Node.prototype.before()
or handles the DOM differently.The text was updated successfully, but these errors were encountered: