Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RichText: revise onSplit prop #10761

Closed
ellatrix opened this issue Oct 18, 2018 · 2 comments · Fixed by #14765
Closed

RichText: revise onSplit prop #10761

ellatrix opened this issue Oct 18, 2018 · 2 comments · Fixed by #14765
Assignees
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

Comments

@ellatrix
Copy link
Member

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 as before and after 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 for null 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.

@ellatrix ellatrix added [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 labels Oct 18, 2018
@ellatrix ellatrix added this to the 4.2 - API freeze milestone Oct 18, 2018
@ellatrix ellatrix self-assigned this Oct 18, 2018
@youknowriad youknowriad modified the milestones: 4.2, WordPress 5.0 Oct 30, 2018
@mcsf
Copy link
Contributor

mcsf commented Oct 31, 2018

Something that this could absorb: #10326

@mtias mtias added the [Status] In Progress Tracking issues with work in progress label Nov 13, 2018
@youknowriad
Copy link
Contributor

This is marked unstable now, so I'm punting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
4 participants