I’m probably missing something simple.
I’m trying to swap the data between two Y.Text. This is my current attempt:
const deltaA = yTextA.toDelta()
const deltaB = yTextB.toDelta()
yTextA.delete(0, yTextA.length)
yTextB.delete(0, yTextB.length)
yTextA.applyDelta(deltaB)
yTextB.applyDelta(deltaA)
It works fine unless one of them has a header formatting (h1, h2, …), in which case the formatting isn’t swapped. Analyzing their deltas I see that they don’t contain the header formatting information.
How can I effectively swap their data in this case?
Note: I’m binding both Y.Text with Quill editors using y-quill.
Thanks.