Fixing caret issue when using maxLength

This commit is contained in:
Francisco Hodge
2018-11-05 17:34:16 -05:00
parent 6475dcacf2
commit d1100cef92
3 changed files with 57 additions and 33 deletions
+6 -2
View File
@@ -173,7 +173,9 @@ class SimpleKeyboard {
if(!this.input[this.options.inputName])
this.input[this.options.inputName] = '';
let updatedInput = this.utilities.getUpdatedInput(button, this.input[this.options.inputName], this.options, this.caretPosition);
let updatedInput = this.utilities.getUpdatedInput(
button, this.input[this.options.inputName], this.options, this.caretPosition
);
if(this.input[this.options.inputName] !== updatedInput){
@@ -184,7 +186,9 @@ class SimpleKeyboard {
return false;
}
this.input[this.options.inputName] = updatedInput;
this.input[this.options.inputName] = this.utilities.getUpdatedInput(
button, this.input[this.options.inputName], this.options, this.caretPosition, true
);
if(debug)
console.log('Input changed:', this.input);