alphagov / govuk-prototype-kit

Rapidly create HTML prototypes of GOV.UK services
https://prototype-kit.service.gov.uk
MIT License
305 stars 236 forks source link

Management pages skip GOV.UK Frontend `initAll()` #2348

Closed colinrotherham closed 1 year ago

colinrotherham commented 1 year ago

Description of the issue

On management pages (including password, error pages) window.GOVUKFrontend.initAll() is not called

This is because GOV.UK Frontend init.js is run too early, before the Prototype Kit window global has been added:

https://github.com/alphagov/govuk-prototype-kit/blob/d262239d601e92cc7af138fcf94c7a26172e6bd2/lib/nunjucks/views/manage-prototype/scripts.njk#L2-L3

Steps to reproduce the issue

Visit a prototype sign in page and click "Continue"

Notice the Error summary component is not focused

Actual vs expected behaviour

Error summary component should have tabindex="-1" with focus outline

Environment (where applicable)