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:47:22 +01:00
parent a57387fe2d
commit 71ae1110ff
+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();