codex-team / codex-team/editor.js
React: Custom react tool gets deleted when subsequent block gets deleted.
- Dominant language
- TypeScript
- Stars
- 31.9k
- Forks
- 2.2k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
## Current Situation
In my React app, I've created several custom tools that render react components. Everything works fine so far, including interactions with react, content editing (with custom edit views/states in the react component), etc.
`@editorjs/editorjs: 2.17.0` is installed.
But the following does not work.
## Current Problem(s)
### Backspace at position 0 in subsequent block
When hitting backspace, the custom block gets deleted.

(see also https://d.pr/i/DuYgCC/1zprl6UkZb)
### Deleting the last item of a list deletes the custom block

(see also https://d.pr/i/LhIjdF/lpEsyTkUPi)
## Expected Behaviour
Instead of deleting the custom blocks, they should persist.*
*Edit*: persist means they should not be deleted, just because the subsequent block gets deleted. The custom block can be deleted (eg. with the tool settings) still.
NOTE: the custom blocks **are not contenteditable**! This would lead to unwanted side-effects (eg. user can edit react content etc.).
## Example App
- https://codesandbox.io/s/editorjs-react-editor-js-example-with-custom-react-component-template-8md15
## Related Issues
- https://github.com/codex-team/editor.js/issues/810 maybe?
---
As always, thank you very much for your help!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.