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
RichTextEditor image upload (Cannot read properties of null (reading 'index')) #1508
Comments
Duplicate of or closely related to #1386 |
Fixed in 4.2.7 |
I'm still have this error on almost all of toolbar button: lists, image... And "addRange(): The given range isn't in document." on other toolbar buttons. |
I'm seeing it on lists too. But it is fixed with images, just make sure you're using at least version 4.2.7 But everything else is fine. What do you mean when you say "almost all of the toolbar button"? I'm also seeing the "index is null" error, and not "addRange()". Could we be talking about different issues? |
The issue happens only in with react strict mode, disable strict mode to fix it. The issue cannot currently be resolved on library side. |
What package has an issue
@mantine/rte
Describe the bug
4. You should see the error `Cannot read properties of null (reading 'index')`
Drag/drop works, pasting works, just the toolbar is causing this error (when wrapped in
<StrictMode>
).In which browser did the problem occur
Chrome
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/bold-field-ilkjez?file=/src/App.js
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
No response
Possible fix
Looks like this.range is reset in the ImageUploader in strict mode.
I could be wrong (and I haven't tested this) but I think we might want to set the range here via
this.range = this.quill.getSelection();
.The text was updated successfully, but these errors were encountered: