Skip to content

Commit

Permalink
Allow events to propagate / default if not used.
Browse files Browse the repository at this point in the history
 - All key events when the menu is not shown now propagate.
 - Blur is also allowed to propagate.
  • Loading branch information
Pete Hopkins committed Feb 22, 2012
1 parent 8609a77 commit 80d03e1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions js/bootstrap-typeahead.js
Expand Up @@ -165,9 +165,6 @@
}

, keyup: function (e) {
e.stopPropagation()
e.preventDefault()

switch(e.keyCode) {
case 40: // down arrow
case 38: // up arrow
Expand All @@ -187,10 +184,11 @@
this.lookup()
}

e.stopPropagation()
e.preventDefault()
}

, keypress: function (e) {
e.stopPropagation()
if (!this.shown) return

switch(e.keyCode) {
Expand All @@ -210,12 +208,12 @@
this.next()
break
}

e.stopPropagation()
}

, blur: function (e) {
var that = this
e.stopPropagation()
e.preventDefault()
setTimeout(function () { that.hide() }, 150)
}

Expand Down

0 comments on commit 80d03e1

Please sign in to comment.