focus last after fields.push() not possible, because no possibility to focus on callback
Hello, I have 1 suggestion, when I push value, can't focus new element, because it is not created yet
fields.push({id: '', name: '', lastName: ''})
setTimeout(()=>{
form.focus(`persons[${fields.value.length}].id`)
},200)
this is how it works now, but obviously, its really bad solution, if fields.push had a callback, it would be nice
just wondering, why fields.push acts like async?
I stumbled upon the same issue. Is there any update on how to focus the new element?
I have the same issue Could you pl help?
This can be solved by creating your own push mutator with a callback. Push mutator is pretty simple if you look into the source code
@Juansasa do you have any examples of this? I can't see how a callback will help in this situation as we need the callback to be triggered once the field has been mounted/appended to DOM, not just directly after pushing to the array.