]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Enable default browser key behaviour when typeahead isn't showing. 1272/head
authorDavid N <dave.noel@gmail.com>
Thu, 26 Jan 2012 23:23:09 +0000 (17:23 -0600)
committerDavid N <dave.noel@gmail.com>
Thu, 26 Jan 2012 23:23:09 +0000 (17:23 -0600)
js/bootstrap-typeahead.js

index fad28ea46b1053fafef3f1e79923a20ae5f5c8c6..82188f5926038de9d20e7f3d4ac20a4467dd445c 100644 (file)
 
         case 9: // tab
         case 13: // enter
+          if (!this.shown) return
           this.select()
           break
 
 
   , keypress: function (e) {
       e.stopPropagation()
+      if (!this.shown) return
 
       switch(e.keyCode) {
         case 9: // tab
           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