From 437e0b0951c736a0dcad72af1e28e029c252d35e Mon Sep 17 00:00:00 2001 From: Ran Luo Date: Sat, 2 Mar 2019 18:44:14 +0800 Subject: [PATCH] fix: Unable to insert text into a table cell (#702) fix#670 --- src/muya/lib/contentState/pasteCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/muya/lib/contentState/pasteCtrl.js b/src/muya/lib/contentState/pasteCtrl.js index 430a1860..487053f6 100644 --- a/src/muya/lib/contentState/pasteCtrl.js +++ b/src/muya/lib/contentState/pasteCtrl.js @@ -166,7 +166,7 @@ const pasteCtrl = ContentState => { if (/th|td/.test(startBlock.type)) { const pendingText = text.trim().replace(/\n/g, '
') - startBlock.text += pendingText + startBlock.text = startBlock.text.substring(0, start.offset) + pendingText + startBlock.text.substring(end.offset) const { key } = startBlock const offset = start.offset + pendingText.length this.cursor = {