question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: target.ownerDocument.createRange is not a function

See original GitHub issue

Using @testing-library/user-event@14.0.4

https://developer.mozilla.org/en-US/docs/Web/API/Range

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:14
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
capricorn86commented, Jun 30, 2022

We finally have full support for document.createRange() and document.getSelection()! 😄

I am sorry that it took such a long time. It was a lot more complicated than I expected and a lot of code had to be written to support this.

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

2reactions
capricorn86commented, May 23, 2022

I have started on implementing it now 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

document.createRange is not a function` error while testing ...
When I run the test, I get the following error - TypeError: document.createRange is not a function . The above error occurred in...
Read more >
TypeError: range.cloneRange is not a function after updating ...
Same issue: I am getting target.ownerDocument.createRange is not a function from statement user.click(..) This is my test: import { render, ...
Read more >
How to fix `TypeError: document.createRange is not a function ...
The issue is with the underlying implementation of PopperJS calling the document.createRange function when there is no DOM API for it to call....
Read more >
Simulate Clicks in a Test with the User Event Library
The user event library provides a series of tools for programmatically interacting with a webpage during a test. Some of the supported events...
Read more >
Document.createRange() - Web APIs | MDN
The Document.createRange() method returns a new Range object.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found