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

Normalize insert_text on edges of inlines/marks #3151

Open
ianstormtaylor opened this issue Nov 28, 2019 · 1 comment
Open

Normalize insert_text on edges of inlines/marks #3151

ianstormtaylor opened this issue Nov 28, 2019 · 1 comment

Comments

@ianstormtaylor
Copy link
Owner

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

Improvement.

What's the current behavior?

Right now we let the DOM determine where the selection ends up, and when an insert_text command is executed we insert wherever the selection is. But because of #3148 this can vary across browsers which is not intuitive for people.

What's the expected behavior?

I think we should have Slate's core behaviors canonicalized, so that it will:

  • Always insert outside of an inline when it's at the edge.
  • Always inside before a mark when it's at the start.
  • Always inside inside a mark when it's at the end.

People can then choose to override these behaviors in their own plugins if they'd like to have "inline continuation", but at least in core it will be consistent.

@beorn
Copy link
Contributor

beorn commented May 1, 2020

I know of #3148 — but would it be possible to give Slate's selection position be sticky and take precedence where possible, so that it's possible to use arrow keys to step through all the positions? I.e., end of inline, start of next node as two different positions we can both move the selection to, and we can insertText into? (Ah, I guess that might require something like #2973 since the editor isn't always available, and as per #3148 not all browsers support all required insertions positions so we couldn't have this granularity relying on the browser/DOM?)

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

No branches or pull requests

2 participants