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

TypeError: element.ownerDocument.getSelection is not a function #370

Closed
linkurzweg opened this issue Feb 18, 2022 · 1 comment
Closed

TypeError: element.ownerDocument.getSelection is not a function #370

linkurzweg opened this issue Feb 18, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@linkurzweg
Copy link

linkurzweg commented Feb 18, 2022

When I test a component with vitest and @testing-library/user-event and try to get an element with getByLabelText, I get the following error:
TypeError: element.ownerDocument.getSelection is not a function

Would be great to have this fixed as well :)

Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Feb 22, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Feb 22, 2022
Mas0nShi added a commit to Mas0nShi/happy-dom that referenced this issue Feb 22, 2022
@capricorn86 capricorn86 added the enhancement New feature or request label Feb 22, 2022
@capricorn86 capricorn86 self-assigned this Feb 22, 2022
capricorn86 added a commit that referenced this issue Feb 22, 2022
capricorn86 added a commit that referenced this issue Feb 22, 2022
#370@minor: Adds basic support for Document.getSelection() and the Se…
@capricorn86
Copy link
Owner

Thanks for reporting @linkurzweg! 🙂

I have added basic support for Document.getSelection(). Hopefully it will solve the problem for you.

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v2.41.0

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

No branches or pull requests

2 participants