diff --git a/.upgradenotes/MDL-86990-2025091206232119.yml b/.upgradenotes/MDL-86990-2025091206232119.yml new file mode 100644 index 00000000000..b3b1ab9df0d --- /dev/null +++ b/.upgradenotes/MDL-86990-2025091206232119.yml @@ -0,0 +1,7 @@ +issueNumber: MDL-86990 +notes: + core: + - message: >- + In toggle.mustache `dataattributes` parameter is deprecated. Use + `extraattributes` instead + type: deprecated diff --git a/public/admin/tool/componentlibrary/content/moodle/components/toggle.md b/public/admin/tool/componentlibrary/content/moodle/components/toggle.md index 0a506dd5d21..10d989e542d 100644 --- a/public/admin/tool/componentlibrary/content/moodle/components/toggle.md +++ b/public/admin/tool/componentlibrary/content/moodle/components/toggle.md @@ -18,7 +18,7 @@ The parameters for the template context are: * extraclasses: Any extra classes added to the toggle input outer container. * checked: If the initial status is checked. * disabled: If toggle input is disabled. -* dataattributes: Array of name/value elements added as data-attributes. +* extraattributes: Array of name/value elements added as attributes. * title: Title text. * label: Label text. * labelclasses: Any extra classes added to the label container. @@ -32,8 +32,8 @@ Checked toggle and with "visually-hidden" label. { "id": "example-toggle-1", "checked": true, - "dataattributes": [{ - "name": "action", + "extraattributes": [{ + "name": "data-action", "value": "toggle-status" }], "title": "Toggle Enabled", @@ -50,8 +50,8 @@ Disabled toggle with extra classes. "id": "example-toggle-2", "disabled": true, "extraclasses": "mt-2 ms-2", - "dataattributes": [{ - "name": "action", + "extraattributes": [{ + "name": "data-action", "value": "toggle-status" }], "title": "Toggle Disabled", diff --git a/public/lib/templates/toggle.mustache b/public/lib/templates/toggle.mustache index 20e35be5665..6a2c18af033 100644 --- a/public/lib/templates/toggle.mustache +++ b/public/lib/templates/toggle.mustache @@ -24,8 +24,8 @@ "id": "reality-toggle-3", "checked": true, "disabled": false, - "dataattributes": [{ - "name": "action", + "extraattributes": [{ + "name": "data-action", "value": "toggle-reality" }], "title": "Title example", @@ -37,9 +37,11 @@