From aec607881897be16f3f344cda068487afa1df8c8 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 5 Mar 2025 22:29:14 +0000 Subject: [PATCH 1/2] MDL-61823 forms: ensure grouped elements have ID attribute. This is used by the forms implementation for faux-label elements so that when they are clicked on, the first input element of the corresponding group is focused. --- lib/form/templates/element-group.mustache | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/form/templates/element-group.mustache b/lib/form/templates/element-group.mustache index 723a24789d7..6aac5cf4b21 100644 --- a/lib/form/templates/element-group.mustache +++ b/lib/form/templates/element-group.mustache @@ -8,7 +8,7 @@ {{/label}} {{$element}} {{#label}} -
+
{{label}}
{{#element.elements}} @@ -19,7 +19,7 @@
{{/label}} {{^label}} -
+
{{#element.elements}} {{{separator}}} From 6717477354584d3fef40d5c81805f8891fb70d05 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Thu, 3 Apr 2025 15:31:40 +0100 Subject: [PATCH 2/2] MDL-61823 question: exclude file element from grouped elements hack. This removes the duplicated label, that was being matched by the previously wide selector to make grouped element labels visible. --- theme/boost/scss/moodle/question.scss | 2 +- theme/boost/style/moodle.css | 2 +- theme/classic/style/moodle.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/theme/boost/scss/moodle/question.scss b/theme/boost/scss/moodle/question.scss index 80c2b9f19e7..fe5c73ced86 100644 --- a/theme/boost/scss/moodle/question.scss +++ b/theme/boost/scss/moodle/question.scss @@ -249,7 +249,7 @@ table.question-bank-table { body.path-question-type { /* Hacks to display the labels within a form group. */ - .fitem .col-form-label.visually-hidden:not(legend):not([for="id_category"]) { + .fitem .col-form-label.visually-hidden:not(legend):not([for="id_category"], [for="id_filetypeslist"]) { position: static; width: auto; height: auto; diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index c1e1dfcab4d..5c1ec45c0ef 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -33942,7 +33942,7 @@ table.question-bank-table .header.checkbox .form-check { body.path-question-type { /* Hacks to display the labels within a form group. */ } -body.path-question-type .fitem .col-form-label.visually-hidden:not(legend):not([for=id_category]) { +body.path-question-type .fitem .col-form-label.visually-hidden:not(legend):not([for=id_category], [for=id_filetypeslist]) { position: static; width: auto; height: auto; diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 4fee6887100..488575f7615 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -33942,7 +33942,7 @@ table.question-bank-table .header.checkbox .form-check { body.path-question-type { /* Hacks to display the labels within a form group. */ } -body.path-question-type .fitem .col-form-label.visually-hidden:not(legend):not([for=id_category]) { +body.path-question-type .fitem .col-form-label.visually-hidden:not(legend):not([for=id_category], [for=id_filetypeslist]) { position: static; width: auto; height: auto;