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

add distinction between split and slice commands #2986

Closed
ianstormtaylor opened this issue Aug 28, 2019 · 1 comment
Closed

add distinction between split and slice commands #2986

ianstormtaylor opened this issue Aug 28, 2019 · 1 comment
Labels

Comments

@ianstormtaylor
Copy link
Owner

ianstormtaylor commented Aug 28, 2019

Do you want to request a feature or report a bug?

Idea.

What's the current behavior?

Right now we have the "split" concept that means splitting a node into two pieces, with the opposite being merge.

But we also use splitting sometimes inside other commands, when we want to ensure that we are at the edge of a node. For example, before inserting a block from a fragment, we need to make sure the cursor is collapsed, and if it's in the middle of an existing block, we need to split that block in half. But if it's already at the end of an existing block, we don't need to do anything.

I think it might be useful to have another concept called "slice" (or maybe something better?) that only splits nodes when it has to. And if it's already at a node's edge, it does nothing.

We don't want to use split for this, because split maps nicely to the user's expectations of the enter key, where even at the edges of a block it'll still split them.

@ianstormtaylor
Copy link
Owner Author

I believe that this may be fixed by #3093, which has changed a lot of the logic in Slate and slate-react especially. I'm going to close this out, but as always, feel free to open a new issue if it persists for you. Thanks for understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant