-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
「Bug」Absolute position doesn't match slateRoot, cannot descent into text #348
Comments
I am seeing this very occasionally also. I think it has something to do with react-editor and the underlying Y.Doc getting out of sync. |
I'm still seeing this an have a solid repro. Repro:
In my schema, the initial text is a paragraph
The code to toggle the list formatting is
Which converts the paragraph to
The initial toggle to apply the formatting works fine, and the selection status is preserved in both editors, but on removing the formatting again, the editor crashes, leading me to think the issue relates to |
It seems that the initial remote cursor selection is something like [0,0], [0, -1], then after making the content a list it becomes [0, 0, 0], [0, 0, -1], but after unwrapping, the selection path is now invalid, and should instead be [0, 0], [0, -1] again, but instead, |
@niuyueyang2022 did you ever figure out a workaround for this? |
The problematic code is
When the nodes are being unwrapped, the deepest text node is becoming it's parent, and so
is throwing. Two questions:
I'm happy to fix this if @BitPhinix can provide some insight on how best to go about it, either return null from absolutePositionToSlatePoint, or catch the error within useDecorateRemoteCursors/getCursorRange and return null if absolutePositionToSlatePoint throws. |
I'm getting this in undo scenarios (using |
The text was updated successfully, but these errors were encountered: