Closed ezakto closed 7 years ago
Hey @ezakto thanks for this. The rich-text
example is just an example of what's possible, in your editor you can choose how you want to handle backspacing at the beginning of a document like this, but it's not something core will handle for it, since it doesn't make assumptions about your schema.
@ianstormtaylor that seems odd as it assumes you want to delete block nodes in other lines?
@ezakto in other cases it's not forced to come up with the node type you want to insert by itself because it's actually just collapsing the content into the previous node, whatever its type may be. In the case of deleting at the start of a single quote block, it would actually need to create a new node (or change the node's type
), and that is a schema-specific decision.
Basically anything where the decision is schema-specific, Slate's core won't handle it. In general this sacrifices a bit smartness in certain cases, like this one, but reduces complexity a lot overall. But I do feel for you that this specific case is an unfortunate casualty of that design decision.
Do you want to request a feature or report a bug?
Bug
What's the current behavior?
Can't delete block nodes in first line.
What's the expected behavior?
It should remove the block (probably defaulting to paragraph?)