-
Notifications
You must be signed in to change notification settings - Fork 90
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
Details polyfill not available in any of the gov repos when npm install'ed #400
Details polyfill not available in any of the gov repos when npm install'ed #400
Comments
@gemmaleigh can you remember why this was the only bit of JS not moved from elements to toolkit? I’ve forgotten the context. |
Hi @andymantell, The details summary polyfill hasn't been moved to the govuk frontend toolkit, as it doesn't have tests to accompany it. There is also an issue that has been raised with it not working as expected when using JAWS with IE. There is work being carried out by the accessibility team to evaluate the patterns in GOV.UK elements, before we move the polyfill to the govuk frontend toolkit - I'd like to be sure this is the recommended pattern for toggling hidden content. @cfq - can you let us know if you have found any issues with the details summary pattern please? |
Ah, thanks @gemmaleigh. I'll commit it into our application's repository for the time being. |
@andymantell or @gemmaleigh - any news on if/when this might be resolved - or what I might use instead? Thanks. |
Hi @RobinKnipe apologies for the slow reply, we will be moving the details polyfill to the GOV.UK Frontend Toolkit. Will update this issue once it is available via the govuk_frontend_toolkit. |
The details polyfill has been moved to Frontend Toolkit as part of v7.1.0. This is so that users of Elements and Frontend Toolkit can make use of it, as Elements only includes the Sass in its packages. This was raised as part of #400
The details polyfill has been moved to Frontend Toolkit as part of v7.1.0. This is so that users of Elements and Frontend Toolkit can make use of it, as Elements only includes the Sass in its packages. This was raised as part of #400
If you
npm install
the gov template, the toolkit and elements (govuk-elements-sass), the expectation is that you should have everything you need to use the gov styles. However, the element polyfill is missing since govuk-elements-sass only includes the sass.Currently the polyfill is here in elements:
https://github.com/alphagov/govuk_elements/blob/master/public/javascripts/govuk/details.polyfill.js
I wonder whether it should perhaps live here instead:
https://github.com/alphagov/govuk_frontend_toolkit/tree/master/javascripts
In my situation, I would then be able to
import
the polyfill along with any other bits of toolkit JS I require.The alternative option might be to publish the polyfill as it's own repository. If it's a good thing that has wider utility beyond gov, perhaps we could consider releasing it in it's own right. I'm not sure of the provenance of the code though - it looks like the original may have come from a blog post? That may complicate matters?
Another alternative might be to cast the net wider and use an open source details polyfill. If we could find one that was 95% good, and open PRs against it for any accessibility issues etc then that might be a good option rather than maintaining our own.
The text was updated successfully, but these errors were encountered: