-
Notifications
You must be signed in to change notification settings - Fork 132
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
Can't select text for more than 1 line #13
Comments
Hi, unfortunately I think this issue is quite complicated... The base reason for not being able to select multiple lines is due to the blocks having However, this raised some other problems -
One potential solution is to dynamically set the To my knowledge, the way the project is currently set up is that individual Here's my rough attempt at dealing with these actions. The general idea is to "lift" the logic for multiple line events to the The above code is deployed here - it's not finished and is still buggy for 'enter', breaks on non-text blocks and doesn't handle bold or italic text. I would greatly appreciate input on the above approach, or if anyone has a better way to approach the issue! |
have you seen editor.js? they have a similar approach |
Yeah, I have taken several cracks at this kind of problem before and there is no great answer. I think The way notion does it is the technical best, but also by far the hardest way. As far as I can tell, notion renders all the blocks into one big contenteditable with many nested contenteditables inside? Then instead of making a new "editor" per "block" the render/editing engine keeps track of the data model and seamlessly displays it as one document. |
Exactly, it's all "one" editor. Even though the data model is blocks it gets rendered as a single logical editor. |
Hey everyone, thanks for the active discussion on this topic! We've also done a little bit of investigation into this and while having a parent contenteditable might work on Chrome, it still breaks on the latest version of Firefox. Interestingly, Notion does not use a parent contenteditable on Firefox, but we haven't dug into how it's implemented yet. |
@greentfrapp if you ever want to chat, I'd love to pick your brain/share some of my notes on the topic from the last time I faced this issue a little while ago. I come from the React side of things, so I don't have any good insight into the implementation side of things with Vue, but I do have some abstract knowledge built up that might be useful. |
@DAlperin I'll love to take you up on that offer! Could you drop an email to [email protected] and we'll set up some time for a video call? |
I've just taken a look at how Wordpress/Gutenberg handles this and this is the approach they take. In both Chrome and Firefox, I can see the contenteditable attribute being toggled on the parent element. I've created a simple test case without Lotion and it looks like it's working fine in Chrome/Firefox/Safari. |
In recent days, I have been using contenteditable to write similar requirements, but my requirements include the requirement to use the mouse to select, right-click to merge two blocks, so that they are displayed in one piece, similar to seamless text, but at the same time to support A single block clicks and triggers a response event, which makes me miserable |
Slatejs might work, let me try it |
according to https://www.blocknotejs.org/ |
Hi guys, |
few bugs found
The text was updated successfully, but these errors were encountered: