jodit icon indicating copy to clipboard operation
jodit copied to clipboard

Selection markers not removed when toggle source mode repeatedly

Open vsubbotskyy opened this issue 4 years ago • 0 comments

Jodit Version: 3.4.29

Browser: Chrome OS: Windows Is React App: False

When toggling source mode a couple of times, new invisible selection spans are added to the document looking like this: <span id="jodit-selection_marker_1605252954424_48109259330683507" data-jodit-selection_marker="start" style="line-height: 0; display: none;"></span>

Demo https://codepen.io/cent/pen/vYKvqBr

Code

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jodit/3.4.29/jodit.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jodit/3.4.29/jodit.js"></script>
<textarea id="editor"></textarea>
<script>
  var editorOptions = {
    iframe: true,
    editHTMLDocumentMode: true,
    sourceEditor: 'area',
  };
  var editor = new Jodit('#editor', editorOptions);
  editor.value = `<!DOCTYPE html><html lang="en"><head></head>
<body spellcheck="true" style="min-height: 104px;">
</body></html>`;
</script>

Expected behavior: Selection removed after toggle

Actual behavior: Spans are not cleaned up, while new ones appear on each toggle

vsubbotskyy avatar Nov 13 '20 07:11 vsubbotskyy