Explorar o código

Avoid focusing search when focused in textareas/selects

Jordi Boggiano %!s(int64=9) %!d(string=hai) anos
pai
achega
e2aba61f5e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/Packagist/WebBundle/Resources/public/js/search.js

+ 1 - 1
src/Packagist/WebBundle/Resources/public/js/search.js

@@ -152,7 +152,7 @@
 
     // handle pressing S to focus the search
     $(document.body).bind('keyup', function (event) {
-        if (event.which === 83 && (!document.activeElement || document.activeElement.tagName !== 'INPUT')) {
+        if (event.which === 83 && (!document.activeElement || -1 === ['INPUT','SELECT','TEXTAREA'].indexOf(document.activeElement.tagName))) {
             $('#search_query_query').focus();
         }
     });