You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a ref directive with a fixed name, 'input' to the input field in PR #69. If it gets accepted then you would be able to reference the input field using:
this.$refs['autocomplete'].$refs['input']
where 'autocomplete' is any name you would add as a ref to the v-autocomplete component. So for example to set the focus on the input field you would use:
this.$refs['autocomplete'].$refs['input'].focus()
Some other info:
I could not get the ref attribute to work when passed in the inputAttrs. I think Vue "compiles" the template long before the value can be set via a property.
In case you are wondering why this is useful, I am using the v-autocomplete in a Bootstrap input-group to add people to a separate list. A button allows me to add names of people who don't already exist in the list. Clicking on the button adds the new or selected person to the list. Being able to set the focus on the input field avoids having the user to shift-tab to get back to the field if they want to add another name.
hi all,
input-attrs is not working for ref, the ref attribute is not shown in input search
The text was updated successfully, but these errors were encountered: