I am using a simplekeyboard for my project, I wrote the function of the delete button myself. I have an input and when I press the 1 key on the keyboard and then delete it and press the 2 key, it appears as 12 in the input. The old input value comes with it. How can I solve this?
My code is as follows;
SimpleKeyboard.vue
case "{delete}":
this.screenStore.handleKeyboardChange(this.screenStore.inputs[this.screenStore.inputName].slice(0, -1));
this.firstCharacter = true;
break;
and screen.js;
handleKeyboardChange(value) {
//console.info("handleKeyboardChange:", value, this.inputName, this.inputs);
if (this.inputName) {
//this.inputs[this.inputName] = value;
Vue.set(this.inputs, this.inputName, value);
eventBus.$emit('keyboard-event-triggered', this.inputName);
var _this = this;
this.checkinFields.forEach(function(field){
console.info(field.id, _this.inputName);
if(field.id == _this.inputName){
var property = field.target;
if(property === 'firstname'){
property = 'firstName';
}
if(property === 'lastname'){
property = 'lastName';
}
_this.appointment.visitor[property] = _this.inputs[_this.inputName];
console.info(_this.appointment);
}
});
}
},
please can someone help me? I’ve been trying to solve this for days