vue-bootstrap-typeahead
vue-bootstrap-typeahead copied to clipboard
More input events: submit, focus, blur
There is already an input event, triggered on input on the <input> (:thinking:...).
It might be useful to have other events :
submit: currently when a user hits enter, nothing happens. I think a significant proportion of the users type a city and hit enter instead of using their mouse. Currently we can't handle it.focus/blur: they are already used in the internal mechanism of the component to toggle the list display. In my case, I would like to use them to empty the input content on focus, and set back the previous selection on blur.
There might be other events interesting to customize, but these are the one for which I have a use case.
I don't know if it's possible to have a generic code that will "pass up" all events from the input to the parent component.
Also, since the component includes an input and a list, it's probably smarter to name these events input-* (input-submit, input-focus, input-blur).
Hi @Owumaro. is there any update to this. It would be really handy if we could listen for the blur event. I added this line
'this.$emit('blur', evt)'
to the handleBlur method in VueBootstrapTypeahead and it works fine.
Hi @Owumaro Have you had a chance to look at this?
Thanks
Hi @birdy247, since this project doesn't seem to be maintained anymore, I am now using and contributing to this repo : https://github.com/KazanExpress/vue-simple-suggest
I think you can accomplish whatever this component does with vue-simple-suggest, and even more (for example the component supports debounce natively).