Merge branch 'MDL-68844-master' of https://github.com/roland04/moodle
[moodle.git] / lib / form / templates / element-group.mustache
index 54c21df..d5cca77 100644 (file)
 require(['jquery'], function($) {
     $('#{{element.id}}_label').css('cursor', 'default');
     $('#{{element.id}}_label').click(function() {
-        $('#{{element.id}}').find('button, a, input, select, textarea, [tabindex]:not([tabindex="-1"])').filter(':enabled').first().focus();
+        $('#{{element.id}}')
+            .find('button, a, input:not([type="hidden"]), select, textarea, [tabindex]')
+            .filter(':not([disabled]):not([tabindex="0"]):not([tabindex="-1"])')
+            .first().focus();
     });
 });
 {{/js}}