You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prevent components from initialising where GOV.UK Frontend is not supported.
Services may know whether we’ll initialise or not using the presence of govuk-frontend-supported on the <body>.
Note: We may complement this with either an IS_SUPPORTED boolean or isSupported() function so both us and services share the same value for sure.
Why
Support for noNodule is not quite the same as support for <script type=”module”>, with Safari 10.1 supporting the later but not the former. This means we’ll need to guard our component’s initialisation the same way we guard the addition of the styling class. Otherwise, we’ll risk running our JavaScript against elements that have not been styled anticipating the JavaScript to run.
What
Prevent components from initialising where GOV.UK Frontend is not supported.
Services may know whether we’ll initialise or not using the presence of
govuk-frontend-supported
on the<body>
.Why
Support for
noNodule
is not quite the same as support for<script type=”module”>
, with Safari 10.1 supporting the later but not the former. This means we’ll need to guard our component’s initialisation the same way we guard the addition of the styling class. Otherwise, we’ll risk running our JavaScript against elements that have not been styled anticipating the JavaScript to run.Who needs to work on this
Developers
Who needs to review this
Developers
Depends on
Define a public API for our components in v5 #3479Done when
The text was updated successfully, but these errors were encountered: