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
For anyone reading this, I had the same problem: I forked the repo and changed line vue-autocomplete.vue:244 into this this.json.length ? this.selectList(this.json[this.focusList]) : e.target.form.submit(). This was sufficient for my use case, but otherwise you could hook it up to another method.
Another possible way to work around this is to attach a listener to the input and suppress the enter key in appropriate circumstances.
mounted() {
const input = this.$refs.autocomplete.$refs.input
input.addEventListener('keydown', this.suppressEnter, false)
},
methods: {
suppressEnter(e) {
// Enter when there are no results breaks things. This is a bug in the plugin, but this works around it.
if (e.which === 13 && this.results.length === 0) {
e.preventDefault()
return false
}
},
Step for reproducing:
1.enter long string (no autocomplete values);
2.press the enter key;
result: error in console
@
The text was updated successfully, but these errors were encountered: