-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Johan Halse
committed
Apr 28, 2015
1 parent
f2417ff
commit 0022f5b
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* Small and fast autocomplete plugin for Zepto and jQuery. | ||
* Written by Johan Halse, https://twitter.com/hejsna, [email protected] | ||
* License: http://johanhalse.mit-license.org | ||
* @version 0.4.2 | ||
* @version 0.4.3 | ||
* @return {object} Self | ||
*/ | ||
(function(window, $) { | ||
|
@@ -517,7 +517,7 @@ | |
this.nextItem(); | ||
} | ||
if(e.keyCode == 13) { // Enter | ||
this.onPressEnter(); | ||
this.onPressEnter(e); | ||
} | ||
if(e.keyCode == 27) { // Esc | ||
e.preventDefault(); | ||
|
@@ -539,7 +539,7 @@ | |
* User has pressed enter, select object or perform search. | ||
* @return {null} | ||
*/ | ||
onPressEnter: function() { | ||
onPressEnter: function(e) { | ||
// If field is filled in but no item is selected, we don't block | ||
// submit | ||
if(this.selectedItem === null) { | ||
|