3👍
✅
You can use setTimeout to apply the focus, it’s not recommended but you can use it, as you have some specific use case here.
Here is the change required
focusField(name) {
this.editField = name;
setTimeout(()=>{
this.$refs[name].focus(); // access the ref and make it focus after a delay make sure element appear in the DOM
},200);
},
You also need to change some of the method bindings from input, like a blur, when you are moving to any other element blur will call automatically.
Also declare all the ref for inputs elements.
Here is the stackblitz
Source:stackexchange.com