MDL-85169 forms: focus grouped fields element based on parent data.

This fixes the previous attempt at focusing the first field within
grouped elements (aec60788) which inadvertently introduced duplicate
IDs.
This commit is contained in:
Paul Holden
2025-05-02 13:34:29 +01:00
parent 15b534da3e
commit 1fe0dee805
+1 -1
View File
@@ -34,7 +34,7 @@
require(['jquery'], function($) {
$('#{{element.id}}_label').css('cursor', 'default');
$('#{{element.id}}_label').click(function() {
$('#{{element.id}}')
$('#{{element.id}}, [data-groupname="{{element.name}}"]')
.find('button, a, input:not([type="hidden"]), select, textarea, [tabindex]')
.filter(':not([disabled]):not([tabindex="0"]):not([tabindex="-1"])')
.first().focus();