Skip to content

Commit

Permalink
fix autoselect always selecting the first suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Moritz Lang committed Sep 5, 2018
1 parent cbfd7eb commit 06265a3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jquery.autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,14 @@
return true;
case ENTER:
if (iOpen) {
$input.trigger('pick.xdsoft');
if (options.autoselect) {
$input.trigger('pick.xdsoft');
} else if (!options.autoselect && active) {
$input.trigger('pick.xdsoft');
} else {
$input.trigger('close.xdsoft');
return true;
}
event.preventDefault();
return false;
} else {
Expand Down

0 comments on commit 06265a3

Please sign in to comment.