reset selection also for local transactions
This commit is contained in:
parent
548125a944
commit
c0972f8158
@ -19,17 +19,17 @@ function _getCurrentRelativeSelection (domBinding) {
|
|||||||
|
|
||||||
export const getCurrentRelativeSelection = typeof getSelection !== 'undefined' ? _getCurrentRelativeSelection : () => null
|
export const getCurrentRelativeSelection = typeof getSelection !== 'undefined' ? _getCurrentRelativeSelection : () => null
|
||||||
|
|
||||||
export function beforeTransactionSelectionFixer (domBinding, remote) {
|
export function beforeTransactionSelectionFixer (domBinding) {
|
||||||
if (remote) {
|
relativeSelection = getCurrentRelativeSelection(domBinding)
|
||||||
relativeSelection = getCurrentRelativeSelection(domBinding)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Reset the browser range after every transaction.
|
||||||
|
* This prevents any collapsing issues with the local selection.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
export function afterTransactionSelectionFixer (domBinding, remote) {
|
export function afterTransactionSelectionFixer (domBinding) {
|
||||||
if (relativeSelection !== null && remote) {
|
if (relativeSelection !== null) {
|
||||||
domBinding.restoreSelection(relativeSelection)
|
domBinding.restoreSelection(relativeSelection)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user