-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview v5: Skip initialisation when GOV.UK Frontend is not supported #2976
Conversation
✅ You can preview this change here:
To edit notification comments on pull requests, go to your Netlify site configuration. |
c9ae343
to
7b4a711
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
@@ -3,7 +3,7 @@ class BackToTop { | |||
* @param {Element} $module - HTML element | |||
*/ | |||
constructor ($module) { | |||
if (!($module instanceof HTMLElement)) { | |||
if (!($module instanceof HTMLElement) || !document.body.classList.contains('govuk-frontend-supported')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these identical constructor-y bits just make me want to do a base component sooner!
67e5a4e
to
399f2fb
Compare
7b4a711
to
08d8b3c
Compare
399f2fb
to
25c911c
Compare
This closes the support gap for browsers without ES module support still loading JavaScript-only styles
See approach on GOV.UK Frontend alphagov/govuk-frontend@7e1d0f4
08d8b3c
to
f5f35e4
Compare
This PR updates
.js-enabled
to.govuk-frontend-supported
as we did for:.govuk-frontend-supported
for ES modules support govuk-frontend#3801Added separately to #2958 as lots of functionality is broken until we preview v5