From 2facca38a128a57dacf0c4ff960ab0d696cefc07 Mon Sep 17 00:00:00 2001 From: Colin Rotherham Date: Thu, 29 Jun 2023 11:00:07 +0100 Subject: [PATCH] Add class `.govuk-frontend-supported` for ES modules support (Checkboxes) Updates the Checkboxes component missed from: * https://github.com/alphagov/govuk-frontend/pull/3801 --- src/govuk/components/checkboxes/checkboxes.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/govuk/components/checkboxes/checkboxes.mjs b/src/govuk/components/checkboxes/checkboxes.mjs index 06b91da0d8..57c0374a12 100644 --- a/src/govuk/components/checkboxes/checkboxes.mjs +++ b/src/govuk/components/checkboxes/checkboxes.mjs @@ -6,7 +6,7 @@ export class Checkboxes { * @param {Element} $module - HTML element to use for checkboxes */ constructor ($module) { - if (!($module instanceof HTMLElement)) { + if (!($module instanceof HTMLElement) || !document.body.classList.contains('govuk-frontend-supported')) { return this }