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

Feature: Arrow navigation and multiple blocks text selection #1

Open
SuperOleg39 opened this issue Oct 15, 2023 · 3 comments
Open

Feature: Arrow navigation and multiple blocks text selection #1

SuperOleg39 opened this issue Oct 15, 2023 · 3 comments

Comments

@SuperOleg39
Copy link
Owner

SuperOleg39 commented Oct 15, 2023

For now, every block is separate tag with contenteditable attribute.

Unfortunately, you can select text only in one focused contenteditable element, and native keyboard navigation not working between blocks.

One possible solution - add contenteditable attribute to editor root element. All of mentioned features will work natively.

There is a big disadvantage - some event handlers to nested contenteditable blocks will not works, example of this problem - https://stackoverflow.com/a/24930829

So, there is a few ways to solve this problem:

  1. Handle text selection and arrow navigation manually - possible rabbit hole of problems and workarounds
  2. Handle root contenteditable elements tree outside of React - need to rewrite existings blocks

Need to investigate and select optimal solution.

@SuperOleg39
Copy link
Owner Author

SuperOleg39 commented Oct 15, 2023

Another solution - is custom events propagation, e.g. https://codepen.io/surf4sites/pen/rNogYzN

But event will be not "trusted", can be problems for example with save content to buffer.

Too many problems with this solution

@SuperOleg39
Copy link
Owner Author

SuperOleg39 commented Oct 15, 2023

@SuperOleg39
Copy link
Owner Author

More about root contenteditable issues and possible solutions - Dashibase/lotion#13 (comment)

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

No branches or pull requests

1 participant