Ensure caretPosition is unset on disableCaretPositioning

This commit is contained in:
Francisco Hodge 2019-01-17 18:36:09 -05:00
parent 6c2236f762
commit 1f9efb0c66

View File

@ -559,6 +559,11 @@ class SimpleKeyboard {
if(instance.options.debug){
console.log("Caret at: ", event.target.selectionStart, event.target.tagName.toLowerCase(), `(${instance.keyboardDOMClass})`);
}
} else if(instance.options.disableCaretPositioning){
/**
* If we toggled off disableCaretPositioning, we must ensure caretPosition doesn't persist once reactivated.
*/
instance.caretPosition = null;
}
});
}