From c0972f8158c0b427b4795c090ec305311fd2d235 Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Tue, 17 Jul 2018 18:49:28 +0200 Subject: [PATCH] reset selection also for local transactions --- src/Bindings/DomBinding/selection.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Bindings/DomBinding/selection.js b/src/Bindings/DomBinding/selection.js index 25798edb..ab6760f5 100644 --- a/src/Bindings/DomBinding/selection.js +++ b/src/Bindings/DomBinding/selection.js @@ -19,17 +19,17 @@ function _getCurrentRelativeSelection (domBinding) { export const getCurrentRelativeSelection = typeof getSelection !== 'undefined' ? _getCurrentRelativeSelection : () => null -export function beforeTransactionSelectionFixer (domBinding, remote) { - if (remote) { - relativeSelection = getCurrentRelativeSelection(domBinding) - } +export function beforeTransactionSelectionFixer (domBinding) { + relativeSelection = getCurrentRelativeSelection(domBinding) } /** + * Reset the browser range after every transaction. + * This prevents any collapsing issues with the local selection. * @private */ -export function afterTransactionSelectionFixer (domBinding, remote) { - if (relativeSelection !== null && remote) { +export function afterTransactionSelectionFixer (domBinding) { + if (relativeSelection !== null) { domBinding.restoreSelection(relativeSelection) } }