Skip to content

React: Custom react tool gets deleted when subsequent block gets deleted. #1067

@natterstefan

Description

@natterstefan

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.

Screen Capture on 2020-03-17 at 13-42-52

(see also https://d.pr/i/DuYgCC/1zprl6UkZb)

Deleting the last item of a list deletes the custom block

Screen Capture on 2020-03-17 at 13-48-38

(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

Related Issues


As always, thank you very much for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions