Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a ref directive to the input field. #69

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added a ref directive to the input field. #69

wants to merge 2 commits into from

Conversation

StuartMacKay
Copy link

A ref directive was added to the input field to allow it to be referenced from outside the component, for example to set input focus. If a ref directive is added to the v-autocomplete component you can reference the input field inside the component like this:

this.$refs['autocomplete'].$refs['input'].focus()

where 'autocomplete' is the component ref and 'input' is the input field ref. A name of 'input' was used since it's obvious what it refers to and there are not other refs in the component thta it might clash with.

A ref directive was added to the input field to allow it to be referenced
from outside the component, for example to set input focus. If a ref
directive is added to the v-autocomplete component you can reference the
input field inside the component like this:

    this.$refs['autocomplete'].$refs['input'].focus()

where 'autocomplete' is the component ref and 'input' is the input field
ref. A name of 'input' was used since it's obvious what it refers to and
there are not other refs in the component thta it might clash with.
@rico
Copy link

rico commented Nov 19, 2018

Hi @paliari it would be great if you could merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants