From 5ee54fe953347d6af4bd507562f5c0d250c52c16 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Fri, 2 May 2025 13:34:29 +0100 Subject: [PATCH] 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. --- lib/form/templates/element-group.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/form/templates/element-group.mustache b/lib/form/templates/element-group.mustache index 723a24789d7..7a4cb3f9d37 100644 --- a/lib/form/templates/element-group.mustache +++ b/lib/form/templates/element-group.mustache @@ -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();