vue-bootstrap-typeahead icon indicating copy to clipboard operation
vue-bootstrap-typeahead copied to clipboard

More input events: submit, focus, blur

Open Owumaro opened this issue 7 years ago • 3 comments

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).

Owumaro avatar Aug 31 '18 10:08 Owumaro

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.

birdy247 avatar May 06 '19 09:05 birdy247

Hi @Owumaro Have you had a chance to look at this?

Thanks

birdy247 avatar May 18 '19 11:05 birdy247

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).

Owumaro avatar May 18 '19 12:05 Owumaro