codex-team / codex-team/editor.js

When I tried to delete the first <span contenteditable='false'> tag of a block, it raised an error

Open
#2,852 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
31.9k
Forks
2.2k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

I'm using a [editorjs-mention-tool](https://github.com/kreudev/editorjs-mention-tool) plugin.

It will insert a `@user` 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:

```

[[kyleockford]]|

```

My caret is at the place of `|` , then I press backspace and I got the error.

related to this function?
https://github.com/codex-team/editor.js/blob/631340912e7a1b3db1e114e930ddf1e97ec4ea61/src/components/utils/caret.ts#L10

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.