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

Input field not being reset #76

Open
ci83rtda opened this issue Apr 2, 2019 · 1 comment
Open

Input field not being reset #76

ci83rtda opened this issue Apr 2, 2019 · 1 comment

Comments

@ci83rtda
Copy link

ci83rtda commented Apr 2, 2019

I am trying to reset the input field after selection with

this.$refs.autocomplete.clear()

But keep getting this error

TypeError: this.$refs.autocomplete is undefined

@rarDevelopment
Copy link

rarDevelopment commented Dec 4, 2019

I know this is a really late reply, but I just ran into this issue and figured it out, so I thought I'd add a reply here for anyone who comes across this unanswered issue like I did. There're two things I had to do, one of which differs from how the example says to do it (unless I missed something).

  1. You have to include ref="autocomplete" on the component itself. This is how it'll add the object you need into this.$refs.
  2. The autocomplete that gets put in there is actually an array, so while the example says to use this.$refs.autocomplete.clear(), what you ACTUALLY have to do is this.$refs.autocomplete[0].clear(). This is the part that's missing in the example given.

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

No branches or pull requests

2 participants