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

Prevent screen readers from announcing document list child/parts items dashes #4066

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

andysellick
Copy link
Contributor

What

Prevent screen readers from announcing the dash before document list child/part items, by changing the CSS pseudo element to use a border to show the dash, instead of a dash character.

Why

Screen readers were announcing the dash character ("em-dash") which is unnecessary and distracting.

Visual Changes

The new border is slightly crisper than the dash character and fractionally narrower and higher than the dash character, but I don't believe the differences are a problem.

Before After
Screenshot 2024-06-18 at 09 52 56 Screenshot 2024-06-18 at 09 53 02

I've used a specific width for the element relative to the padding left of the list element, so that when the text size increases the dash remains the same size (otherwise it could overlap the text of the item, as the padding is fixed). Here's a screenshot of it with an increased text size.

Before After
Screenshot 2024-06-18 at 09 57 20 Screenshot 2024-06-18 at 09 56 14

Trello card: https://trello.com/c/yhLOWoMp/876-dashes-before-each-document-list-item-in-mobile-tablet-view-read-by-screen-readers-m

@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4066 June 18, 2024 08:59 Inactive
@andysellick andysellick force-pushed the fix-document-list-list branch from 163225d to 19a5f8d Compare June 18, 2024 08:59
@andysellick andysellick requested a review from MartinJJones June 18, 2024 08:59
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4066 June 18, 2024 08:59 Inactive
- prevent screen readers from announcing the dash before document list child/part items, by changing the CSS pseudo element to use a border to show the dash, instead of a dash character
@andysellick andysellick force-pushed the fix-document-list-list branch from 19a5f8d to e931078 Compare June 18, 2024 09:00
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-4066 June 18, 2024 09:00 Inactive
Copy link
Contributor

@MartinJJones MartinJJones left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on the fix and updating the accessibility criteria, tested in VoiceOver in finder-frontend and the dash is no longer announced 👍

@andysellick andysellick merged commit e40e547 into main Jun 18, 2024
11 checks passed
@andysellick andysellick deleted the fix-document-list-list branch June 18, 2024 10:45
@MartinJJones MartinJJones mentioned this pull request Jun 26, 2024
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.

3 participants