vue-typeahead-bootstrap
vue-typeahead-bootstrap copied to clipboard
Emit More Events?
This is a discussion/brainstorm PR at this point. All thoughts are welcome.
Premise
I believe we can provide more a more usable API by bubbling more events up to the users of this component. I'm honestly not sure what those are at this point and am open to suggestions. I'm putting this PR here as a place for me to jot ideas down as I have them and collect suggestions from anyone else who has them. I think that as we work through the issues (#25) and PRs (#23) from the parent repo we might find some ideas for this as well.
Currently Documented Events
-
hit
-
input
(does this really count as an "event"?)
Possible Events to Emit
- various keypresses (
enter
,esc
, arrows,tab
, etc) -
closed
- when the dropdown is closed
I'd be in favor of dropdown closed, or at least some sort of blur event. I have a case where I'd like to revert the displayed value to the initially selected value if the user focuses the input text, clears it, and then it loses focus.
I think we should support most of the popular events of an input, such as focus, blur, change, keyup, keydown.
Hey, can we get support for the blur event? @mattzollinhofer