Explorar el Código

Avoid focusing search when focused in textareas/selects

Jordi Boggiano hace 9 años
padre
commit
e2aba61f5e
Se han modificado 1 ficheros con 1 adiciones y 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();
         }
     });