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
range.js:194 addRange(): The given range isn't in document when calling 'insertImage' #4611
Comments
Have you tried this from the latest source, it will require you building the project on your local machine? Are there many people calling this from outside of Summernotes API though? I've not seen (or remember) other issues related to this specifically, though it could be something that could be useful. |
@diemendesign I've cloned it, how do I build it ? |
Did you fork the project, and then clone it to your local machine? (some people clone the main project, and try to push changes directly, which isn't the way to do it). Instructions are also here: https://github.com/summernote/summernote/blob/develop/.github/CONTRIBUTING.md |
I should add, (and probably add it to the instructions), if you're considering submitting PR's with changes, make a copy of the cloned repository, and do the changes, building, and testing there. When you're happy with your changes, then copy the changed files to the clone, then push your changes back to your fork from there, so you can then submit your PR from the fork. If you build the clone, you will also push the |
@diemendesign if I reference the |
Not sure what to tell you, I use a folder outside of the Summernote project that I use to test changes, using the <link rel="stylesheet" href="../summernote-test/dist/summernote-lite.css">
<script type="text/javascript" src="../summernote-test/dist/summernote-lite.js"></script>
$(document).ready(function() {
$('.summernote').summernote();
} |
Silly question, has jQuery also been included, and Bootstrap if your using one of those versions of Summernote? |
@diemendesign yes jquery 3.6.0, bootstrap 3.4.1 and tried 4.0.0 also
but when I replace it with
my document.ready |
Is there anything else on the page, other than jQuery, Bootstrap (if you're using that), and Summernote, that could be interfering. |
only my own custom js, no other libraries, |
I'm calling
$('#id').summernote("insertImage", url);
from the console it works ok.
But when I call it from a button (button outside summernote container)
click
event handler, I'm getting this in the console:summernote.js line that starts this is:
return context.invoke.apply(context, lists.from(arguments));
and my current workaround is to call it in a
setTimeout
using windows 10, chrome 121, summernote 0.8.18
The text was updated successfully, but these errors were encountered: