Skip to content

Commit

Permalink
#233 - clear typeahead internal value when picking a suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaith committed Jan 21, 2015
1 parent aa4cc8b commit 18ecae6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions static/js/form-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ $(function() {
e.stopPropagation();
var value = suggestion[$(e.target).data('valueKey')];
var name = $(e.target).data('name');
var $input = $('input[name="' + name + '"]', $(e.target).parents('form'));
$input = makeInput(e.target, name, value);

//clear the internal query value, so that the box is blank after losing focus
var $typeahead = $('.tt-input', $(e.target).parents('.twitter-typeahead'));
$typeahead.typeahead('val','');

var $input = makeInput(e.target, name, value);
showSelectedValue($(e.target), $input, suggestion);
}
function onEventGroupChanged(e, department) {
Expand Down

0 comments on commit 18ecae6

Please sign in to comment.