typeahead: add "selected" custom event
Created by: evil-shrike
I need to handle a case when a user selects an options from dropdown menu. I need to distinguish entered text and chosen from dropdown menu. It's imposible without the custom event.
, select: function () {
var val = this.$menu.find('.active').attr('data-value')
this.$element.val(val)
this.$element.change();
this.$element.trigger("selected"); // <- ADD THIS
return this.hide()
}