From 8942598ef8774e2dfb9248cb5bd0010a745a9c42 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Tue, 31 Oct 2017 22:25:29 -0700 Subject: [PATCH] Avoid changing selection when deleting old content (#1361) --- packages/slate-react/src/plugins/after.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/slate-react/src/plugins/after.js b/packages/slate-react/src/plugins/after.js index f556ccc73..867b1089b 100644 --- a/packages/slate-react/src/plugins/after.js +++ b/packages/slate-react/src/plugins/after.js @@ -465,9 +465,7 @@ function AfterPlugin() { // Change the current value to have the leaf's text replaced. change - .select(entire) - .delete() - .insertText(textContent, leaf.marks) + .insertTextAtRange(entire, textContent, leaf.marks) .select(corrected) }