RichText: revise onSplit prop #10761
Labels
[Feature] Block API
API that allows to express the block paradigm.
[Feature] Rich Text
Related to the Rich Text component that allows developers to render a contenteditable
[Status] In Progress
Tracking issues with work in progress
Milestone
We should revise the
onSplit
RichText prop as this is a very weird API that tries to handle too many things. If is used for both RichText splitting (on ENTER) and for paste. If it's used for paste,null
may be be passed asbefore
andafter
values (if pasting at the very start or end of the field), which may seem unexpected as a block implementor. Even in our own core blocks we do not always account fornull
being passed. Only when pasting there is a third argument with an array of blocks that may need to be inserted. Special paste handling may not always be wanted, e.g. in the list block we want pasted content to convert to list items, not cause a split and insert in between.I think it would make more sense to separate the two, which would also make the API clearer. Still thinking on the best way to handle it, but I wanted to file this issue so it is known for API freeze.
The text was updated successfully, but these errors were encountered: