Skip to content

Commit

Permalink
Merge pull request #164 from manstie/patch-1
Browse files Browse the repository at this point in the history
Fix accessing toDelta on non-Y.Text instances
  • Loading branch information
dmonad authored Aug 12, 2024
2 parents 8c28539 + 876695b commit 26d1bd0
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 26d1bd0

Please sign in to comment.