Skip to content
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

Update index.md to mention that govuk-frontend javascript will auto-focus #3819

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edwardhorsford
Copy link
Contributor

@edwardhorsford edwardhorsford commented May 29, 2024

The guidance makes it clear that the errorSummary should be focused on page load, but doesn't mention that this should happen for free with the govuk-frontend javascript.

Hopefully this makes it clearer so teams don't spend time trying to re-impliment this.

See similar PR on the NHS Service manual

Fixes #3818

Copy link

netlify bot commented May 29, 2024

You can preview this change here:

Built without sensitive environment variables

Name Link
🔨 Latest commit 5a9b45e
🔍 Latest deploy log https://app.netlify.com/sites/govuk-design-system-preview/deploys/665744426942d50009aa62bd
😎 Deploy Preview https://deploy-preview-3819--govuk-design-system-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@owenatgov
Copy link
Contributor

Thanks for this Ed. There are a few examples of this where we tell a user to do something when, if govuk is imported properly, it'll just happen. There's a bigger piece of work to remove all of these but for now I wonder if the solution is to just remove this line entirely. Maybe add something saying what the component will do. What do you reckon @edwardhorsford?

@edwardhorsford
Copy link
Contributor Author

Thanks for this Ed. There are a few examples of this where we tell a user to do something when, if govuk is imported properly, it'll just happen. There's a bigger piece of work to remove all of these but for now I wonder if the solution is to just remove this line entirely. Maybe add something saying what the component will do. What do you reckon @edwardhorsford?

If you remove the line, I'd make sure to note somewhere that the element should be focused on page load - and that the js should do that for you. I think focusing is disabled in the examples, and if a team were reimplementing they might not know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Suggestion: guidance should mention that govuk-frontend javascript will auto-focus errrorSummaries
2 participants