I am having an issue with the Add button on my webpage. When clicked, this button should reveal an input field for the user to use. However, I want the Add button to be disabled once it has been clicked and the input field appears. Right now, when I try to disable the Add button, it seems to happen before the input field is displayed.
This is the code I am currently using:
button.btn(data-toggle='collapse', data-target='#addNewField', @click='disableBtn($event)') Add
#addNewField.collapse
input.form-control(type='text', v-model='inputValue'...)
disableBtn(event: Event) {
let el = event.target as HTMLElement;
el.querySelector("button");
el.setAttribute("disabled", "");
}
How can I ensure that the button is disabled only after the input field becomes visible?