Skip to content

Commit

Permalink
Algolia modal pops up immediately (#340)
Browse files Browse the repository at this point in the history
when type 's' in textarea (some comment plugin use textarea tag), the search modal will show.
#334
  • Loading branch information
Lxxyx authored and LouisBarranqueiro committed Jan 13, 2017
1 parent bccd834 commit 1223050
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/_js/search-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
// open modal when `s` button is pressed
$(document).keyup(function(event) {
var target = event.target || event.srcElement;
// exit if user is focusing an input
if (target.tagName.toUpperCase() === 'INPUT') {
// exit if user is focusing an input or textarea
var tagName = target.tagName.toUpperCase();
if (tagName === 'INPUT' || tagName === 'TEXTAREA') {
return;
}

Expand Down

0 comments on commit 1223050

Please sign in to comment.