From 40223746207dc154cc6099c4059a8bb079e45cce Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Mon, 16 Jul 2018 18:15:24 +0200 Subject: [PATCH] dombinding: always set browser range after change --- src/Bindings/DomBinding/DomBinding.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/Bindings/DomBinding/DomBinding.js b/src/Bindings/DomBinding/DomBinding.js index 87833c13..beabb910 100644 --- a/src/Bindings/DomBinding/DomBinding.js +++ b/src/Bindings/DomBinding/DomBinding.js @@ -140,7 +140,6 @@ export default class DomBinding extends Binding { restoreSelection (selection) { if (selection !== null) { const { to, from } = selection - let shouldUpdate = false /** * There is little information on the difference between anchor/focus and base/extent. * MDN doesn't even mention base/extent anymore.. though you still have to call @@ -159,7 +158,6 @@ export default class DomBinding extends Binding { if (node !== baseNode || offset !== baseOffset) { baseNode = node baseOffset = offset - shouldUpdate = true } } } @@ -171,18 +169,15 @@ export default class DomBinding extends Binding { if (node !== extentNode || offset !== extentOffset) { extentNode = node extentOffset = offset - shouldUpdate = true } } } - if (shouldUpdate) { - browserSelection.setBaseAndExtent( - baseNode, - baseOffset, - extentNode, - extentOffset - ) - } + browserSelection.setBaseAndExtent( + baseNode, + baseOffset, + extentNode, + extentOffset + ) } }