Open pubuzhixing8 opened 3 years ago
Hi @pubuzhixing8,
Thanks for reporting this issue!
You are correct that this is related to the translation of the split-node
operations. It's currently out of the scope for the initial v4 release but this is definitely something that should be fixed in the future.
Bug description
The cursor of user Adrain Frami was incorrectly converted, and it should be positioned at the last position of the second paragraph。
Cause
We analyzed the reason for this problem. Due to the operation of slate to yjs, the original yjs structure data was deleted (the data structure corresponding to the user's Adrain Frami focus), so an exception occurred when the absolutePositions was converted through relativePosition, and the original corresponding relationship be broken.
Resolve
First of all, I don’t have a solution to this problem. I understand that it may be related to split_node operation.
https://github.com/BitPhinix/slate-yjs/blob/64775edc70eded3f67574c19c825befe4eae177d/src/applyToYjs/node/splitNode.ts#L13
I am not sure if the next branch or v4 is trying to solve this problem