I have a simple form that is hidden when loading a page using v-show. I want to focus the input after it is shown. I have a button for calling a method that shows the form and sets focus on the input using this code:
this.newQuestion = true;
this.$refs.questionInput.focus();
The problem is that the form is displayed correctly, but the input is not focused the first time I click the button, if I click it the second time the form is on the page on which it works. I want to know if there is a way to do this, thanks.
source
share