Skip to content

Commit

Permalink
Fix accessing toDelta on non-Y.Text instances
Browse files Browse the repository at this point in the history
  • Loading branch information
manstie authored Aug 11, 2024
1 parent 8c28539 commit 876695b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugins/sync-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ export const createNodeFromYElement = (
// This is a fix for #160 -- duplication of characters when two Y.Text exist next to each
// other.
const nextytext = type._item.right?.content.type
if (nextytext != null && !nextytext._item.deleted && nextytext._item.id.client === nextytext.doc.clientID) {
if (nextytext instanceof Y.Text && !nextytext._item.deleted && nextytext._item.id.client === nextytext.doc.clientID) {
type.applyDelta([
{ retain: type.length },
...nextytext.toDelta()
Expand Down

0 comments on commit 876695b

Please sign in to comment.