BitPhinix / slate-yjs

Yjs binding for Slate
https://docs.slate-yjs.dev
MIT License
508 stars 72 forks source link

Path doesn't match yText, yTarget spans multiple nodes #394

Closed juliankrispel closed 1 year ago

juliankrispel commented 1 year ago

When deleting several adjacent text Elements and then undoing that delete, yText becomes out of sync

Here's a loom that shows how to reproduce this issue step by step: https://www.loom.com/share/03b82e9b70404035ac9b9f45c6c65e9e

juliankrispel commented 1 year ago

I'm actively looking to fix this but any pointers would be massively appreciated cc @BitPhinix

juliankrispel commented 1 year ago

I've tracked the bug down to the withYHistory plugin see here -> https://www.loom.com/share/60ea7c048c664a2ba78a91d99817d4ea

BitPhinix commented 1 year ago

Hi, Julian thanks for the Issue! Could you check if this still happens in 1.0?

juliankrispel commented 1 year ago

thanks for your response @BitPhinix - yes it is still happening - I will have to work on fixing this issue in the coming weeks - any pointers would be greatly appreciated 🙏 https://www.loom.com/share/30a3d0bdff46467ba0846f9d7ec33531

juliankrispel commented 1 year ago

@BitPhinix I have a pr open that fixes the issue, complete with loom this is at https://github.com/BitPhinix/slate-yjs/pull/402