-
Notifications
You must be signed in to change notification settings - Fork 280
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
Uncaught TypeError: Cannot read property 'createRange' of null #302
Comments
Here's the error from a un-minified version. The error appears to be in SelectionRegion#getClientRectsRegion code. And the
|
Ok, thanks to finding the source I discovered the action that triggers this. If you type some text into the editable area and then quickly (via tab or a mouse click) make the focus exit the editor. Then there's a good chance this error is triggered. Because this is a race condition this could happen unexpectedly during normal user interactions. Basically the issue is that AlloyEditor debounces the firing of the |
Hey @dantman, We have other public functions, which rely on the native selection. They shouldn't throw exceptions neither. Thanks, |
I think it has. |
Okay, so let's go with this commit then. I also would like to emphasize that I highly appreciate your contribution, it helped a lot! Thanks, |
I get this error at during various user interactions. It's hard to pinpoint the type of or order of events that triggers it.
It's not always
createRange
, but it's always a range related name.When these errors happen, nothing in the UI or editable block appears to break. So this seems to be a case of something being triggered when it isn't needed and not validating things before using it. Which probably can be fixed simply by testing before doing things.
((Note that personally that kind of error is a bigger problem. Because I treat uncaught errors as a reason to warn the user of a potential bug and recommend a refresh.))
The text was updated successfully, but these errors were encountered: