Skip to content

Added a ref directive to the input field.#69

Open
StuartMacKay wants to merge 2 commits intopaliari:masterfrom
StuartMacKay:master
Open

Added a ref directive to the input field.#69
StuartMacKay wants to merge 2 commits intopaliari:masterfrom
StuartMacKay:master

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