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

make insertBlock work with unset selections #2329

Closed
ianstormtaylor opened this issue Oct 26, 2018 · 3 comments
Closed

make insertBlock work with unset selections #2329

ianstormtaylor opened this issue Oct 26, 2018 · 3 comments

Comments

@ianstormtaylor
Copy link
Owner

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

Improvement.

What's the current behavior?

Right now insertBlock inserts based on the current selection. But if the selection is unset because there are no nodes in the document, it will fail.

What's the expected behavior?

Instead, I think it should default to inserting at the end of the document in this case, and focusing the editor. This way you don't have to always make this distinction yourself and branch in your own code, since it's a common use case.

@ianstormtaylor ianstormtaylor changed the title fix insertBlock to work with unset selections make insertBlock to work with unset selections Oct 26, 2018
@ianstormtaylor ianstormtaylor changed the title make insertBlock to work with unset selections make insertBlock work with unset selections Oct 26, 2018
@ericedem
Copy link
Contributor

Where would the selection go, probably at the end of the inserted block?

@ianstormtaylor
Copy link
Owner Author

@ericedem yup!

@ianstormtaylor ianstormtaylor mentioned this issue Nov 6, 2019
@ianstormtaylor
Copy link
Owner Author

Fixed by #3093.

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

Successfully merging a pull request may close this issue.

2 participants