From 2fec9b1e646d77b68d3157d12a58f585e3346aa2 Mon Sep 17 00:00:00 2001 From: vivaxy Date: Mon, 26 Jul 2021 20:20:20 +0800 Subject: [PATCH] fix: attributes may not applied to texts resolves: #319 --- src/types/YText.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/types/YText.js b/src/types/YText.js index 0bf4d567..f9eaaa24 100644 --- a/src/types/YText.js +++ b/src/types/YText.js @@ -164,13 +164,13 @@ const insertNegatedAttributes = (transaction, parent, currPos, negatedAttributes } const doc = transaction.doc const ownClientId = doc.clientID - let nextFormat = currPos.left - const right = currPos.right + const left = currPos.left + let right = currPos.right negatedAttributes.forEach((val, key) => { - nextFormat = new Item(createID(ownClientId, getState(doc.store, ownClientId)), nextFormat, nextFormat && nextFormat.lastId, right, right && right.id, parent, null, new ContentFormat(key, val)) - nextFormat.integrate(transaction, 0) - currPos.right = nextFormat + right = new Item(createID(ownClientId, getState(doc.store, ownClientId)), left, left && left.lastId, right, right && right.id, parent, null, new ContentFormat(key, val)) + right.integrate(transaction, 0) }) + currPos.right = right } /**