-
-
Notifications
You must be signed in to change notification settings - Fork 125
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
Cursor plugin causes word breaking #97
Comments
Hi @bkempe, As we discussed in the last Y Community meeting, there is no good solution for this. The reason why the words break is that the user-name is represented using a HTML block element. WebKit will automatically break when they see a block element. Gecko-based browsers won't break the word. Btw, if you the the div to .ProseMirror-yjs-cursor > div {
display: none;
} An alternative solution would be to use the same approach that I'll leave this issue open in case somebody finds a better solution. |
@dmonad Thanks for looking into this! One compromise solution may be to only wrap URLs(which are the most likely items to be long in a typical notepad) in a block. |
That makes sense. You can basically set them in a |
There's now a solution to this problem. See yjs/y-codemirror.next#12 I'll be porting the solution to y-prosemirror (probably in the next ~two weeks). But if somebody wants to give this a try, that would be great! |
@dmonad BTW, this is how Atlassian, which also uses Prosemirror, does it: https://bitbucket.org/atlassian/atlassian-frontend-mirror/src/f388d30ecaa34cf83e8d8a55167b800c9f027db9/editor/editor-core/src/plugins/collab-edit/utils.ts?at=master#lines-105 |
This issue is finally fixed in |
Checklist
Describe the bug
The cursor plugin breaks words which can be observed especially when the cursor is placed in long words and using a smaller width of the text space.
To Reproduce
Steps to reproduce the behavior:
The DOM looks like this:
Expected behavior
Words should not get broken. Example: https://slate-yjs.dev/remote-cursors-overlay
Screenshots
Additional context
We are a Sponsor :)
The text was updated successfully, but these errors were encountered: