mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-04-30 00:00:04 +08:00
Reset caret position on clearInput, replaceInput
This commit is contained in:
@@ -307,6 +307,11 @@ class SimpleKeyboard {
|
||||
inputName = inputName || this.options.inputName;
|
||||
this.input[inputName] = "";
|
||||
|
||||
/**
|
||||
* Reset caretPosition
|
||||
*/
|
||||
this.caretPosition = 0;
|
||||
|
||||
/**
|
||||
* Enforce syncInstanceInputs, if set
|
||||
*/
|
||||
@@ -349,6 +354,11 @@ class SimpleKeyboard {
|
||||
*/
|
||||
replaceInput(inputObj) {
|
||||
this.input = inputObj;
|
||||
|
||||
/**
|
||||
* Reset caretPosition
|
||||
*/
|
||||
this.caretPosition = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user