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

SummaryList output for screenreaders #402

Closed
paulodeon opened this issue Feb 27, 2023 · 4 comments
Closed

SummaryList output for screenreaders #402

paulodeon opened this issue Feb 27, 2023 · 4 comments

Comments

@paulodeon
Copy link

We had some feedback from the Digital Accessibility Centre regarding the output of GovukComponent::SummaryListComponent::ActionComponent

Some link text was formatted in a way that weas difficult for screen reader users to understand.

The ‘change’ link within the ‘Your name’ row within the summary list is formatted such that screen reader software does not reliably interpret it. The space between the link text and the hidden text is not recognised by some screen reader software, and thus will not be announced properly to screen reader users. For example, ‘Change your name’ is interpreted as ‘Changeyour name’.

Current output

<a class="govuk-link" href="/referrals/3/referrer 
name/edit?return_to=%2Freferrals%2F3%2Freferrer"> 
Change <span class="govuk-visually-hidden">your name</span> 
</a> 

Solution

For reliable screen reader parsing of link text, we recommend placing a non-breaking space character in the visually-hidden text using the HTML entity “ ”. Placing the non breaking space within the visually hidden text prevents a space from being placed at the end of the visible link. The trailing space before the visually hidden can then be removed to prevent some browsers from interpreting two spaces adjacent to each other.

<a class="govuk-link" href="/referrals/3/referrer 
name/edit?return_to=%2Freferrals%2F3%2Freferrer"> 
Change<span class="govuk-visually-hidden">&nbsp;your name</span> </a>

Is this something we'd accept into the library?

Happy to create a PR if so

@peteryates
Copy link
Member

Ah, interesting!

Yeah I'd be more than happy to accept it - having to do it manually definitely feels a bit clunky. I think it should at least be a global config option, but perhaps should be an argument too?

@paulodeon
Copy link
Author

It feels to me like a project setting i.e. either you care about it or you don't for the whole project.

How should I contribute - it seems I don't have write access to the repo - should I fork and create the PR that way?

Or is it better to add me to the repo?

@frankieroberto
Copy link
Collaborator

This is also being tracked upstream here by the Design System team: alphagov/govuk-frontend#2547

@peteryates
Copy link
Member

I think this is solved now.

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

No branches or pull requests

3 participants