I'm using a editorjs-mention-tool plugin.
It will insert a <span contenteditable='false'>@user</span> tag into a block inner html.
But if this span tag located at the first element of the block, when I tried to press the backspace keyboard button to delete the whole span, I got this error.
Failed to execute 'setEnd' on 'Range': There is no child at offset 15.
IndexSizeError: Failed to execute 'setEnd' on 'Range': There is no child at offset 15.
situation:
<div class="ce-paragraph cdx-block" contenteditable="true" data-placeholder-active="Let's write an awesome story!" data-empty="false"><span href="kyleockford" contenteditable="false" class="mention_tool_at">[[kyleockford]]</span>|</div>
My caret is at the place of | , then I press backspace and I got the error.
related to this function?
|
export function getCaretNodeAndOffset(): [ Node | null, number ] { |