Skip to content

Commit

Permalink
fix non-alphanumeric triggering search
Browse files Browse the repository at this point in the history
  • Loading branch information
johann committed Aug 18, 2014
1 parent 1c4ab8f commit e52e9f7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions shared/src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@

}, false);

var alphaNum = /[a-zA-Z0-9]/;
document.addEventListener("keydown", function (event) {
if(event.target === searchInput){
return;
Expand Down Expand Up @@ -240,8 +241,11 @@
setActiveGroup(logos[5]);
break;
default:
searchInput.value = "";
searchInput.focus();
var str = String.fromCharCode(event.keyCode);
if(alphaNum.test(str)){
searchInput.value = "";
searchInput.focus();
}
break;
}
});
Expand Down

0 comments on commit e52e9f7

Please sign in to comment.