Open dbudde opened 5 years ago
Well, this creates a new issue. If I click in the URL input box and then just click back into the editor, the highlight sticks around this way too. So, I guess I don't really know the fix, just see a problem that you can reproduce with the instructions I first gave.
Hi @dbudde the Mindmup repo is no longer maintained and hasn't been updated in quite a while. Can you try this out on our demo page http://steveathon.github.io/bootstrap-wysiwyg/ and let us know if this is still an issue?
Yes, I just tested it at this link (thank you for that by the way) and the problem still occurs. The way I have fixed it for the moment was to update the 'saveSelection' with the code I showed above and then I call the 'markSelection' method by hooking into the 'blur' event on the URL input field. I am not putting the 'data-edit="createLink"' on the URL input directly like the example has it done. Instead I use the add button to kick that off, just so you know. Part of the reason for my changes was I am integrating Bootstrap 4.1 with Font Awesome 5. I'm attaching an image so you can see what the GUI looks like (not that it addresses this issue).
I have found an instance of when 'saveSelection' is called, that it incorrectly saves a selection outside of the editor. You can reproduce the issue by going to (https://mindmup.github.io/bootstrap-wysiwyg/) and following these instructions.
You should see the temporary highlight stick around rather than have the selection return properly. Here is my suggested fix.