From: David N Date: Thu, 26 Jan 2012 23:23:09 +0000 (-0600) Subject: Enable default browser key behaviour when typeahead isn't showing. X-Git-Tag: v2.0.0~6^2~129^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1272%2Fhead;p=thirdparty%2Fbootstrap.git Enable default browser key behaviour when typeahead isn't showing. --- diff --git a/js/bootstrap-typeahead.js b/js/bootstrap-typeahead.js index fad28ea46b..82188f5926 100644 --- a/js/bootstrap-typeahead.js +++ b/js/bootstrap-typeahead.js @@ -157,6 +157,7 @@ case 9: // tab case 13: // enter + if (!this.shown) return this.select() break @@ -172,6 +173,7 @@ , keypress: function (e) { e.stopPropagation() + if (!this.shown) return switch(e.keyCode) { case 9: // tab @@ -181,13 +183,11 @@ break case 38: // up arrow - if (!this.shown) return e.preventDefault() this.prev() break case 40: // down arrow - if (!this.shown) return e.preventDefault() this.next() break