Open gtona-mec opened 5 years ago
Yep, good point. I labeled this as an enhancement because it is "technically" working as designed, but I agree it's a stupid design that doesn't make much sense. Submit should receive the result from the dropdown list if clicked or selected from there, or the value of the input field if pressing enter without selecting a result from the list.
Thank you for quick response I'll wait for v3.0.
A workaround that works well for me is I fallback to the value of the input when the passed argument is undefined:
<template>
<autocomplete ref="searchInput" @submit="submit" />
</template>
<script>
export default {
methods: {
submit(query) {
const q = query || this.$refs.searchInput.value;
}
}
}
</script>
Hi, I' like to brig your attention on this issue: As you can test in the example https://autocomplete.trevoreyre.com/#/vue-component?id=submit if you type the name of a country (also completely e.g Cambodia) and pres enter key you will receive an undefined in the "result" argument of function handleSubmit.
This is quite boring when reading from a barcode for example.
Thanks for attention. GT