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

Add aria-controls and aria-describedby attribute options to the button component #3088

Merged
merged 2 commits into from
Nov 29, 2022

Conversation

johnny-m-young
Copy link
Contributor

@johnny-m-young johnny-m-young commented Nov 28, 2022

What

Trello ticket link
Add aria-controls and aria-describedby attribute options to the button presenter.

Why

If aria-label is updated without changing focus it is not read out and so consequently cannot be used, instead the text of the button is read which is in some cases is not verbose enough for screenreaders. Adding aria-describedby makes the function of the button more clear.
The aria-controls attribute is used to signal to the screenreader the section of the page that is relevant when the button is pressed, enhancing screenreader user experience.

@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 28, 2022 09:59 Inactive
@johnny-m-young johnny-m-young force-pushed the add-aria-attribute-to-button branch from ca16283 to 0c2ca0b Compare November 28, 2022 10:00
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 28, 2022 10:00 Inactive
@johnny-m-young johnny-m-young force-pushed the add-aria-attribute-to-button branch from 0c2ca0b to 29b8463 Compare November 28, 2022 10:04
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 28, 2022 10:04 Inactive
@johnny-m-young johnny-m-young changed the title WIP: Button presenter Add aria attributes to button presenter Nov 28, 2022
@johnny-m-young johnny-m-young force-pushed the add-aria-attribute-to-button branch from 29b8463 to 1ca5616 Compare November 28, 2022 10:21
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 28, 2022 10:21 Inactive
@johnny-m-young johnny-m-young changed the title Add aria attributes to button presenter Add aria attributes to button component Nov 28, 2022
@johnny-m-young johnny-m-young changed the title Add aria attributes to button component Add aria-controls and aria-describedby options to button component Nov 28, 2022
@johnny-m-young johnny-m-young force-pushed the add-aria-attribute-to-button branch from 1ca5616 to d1e1c40 Compare November 28, 2022 10:36
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 28, 2022 10:37 Inactive
@johnny-m-young johnny-m-young force-pushed the add-aria-attribute-to-button branch from d1e1c40 to de89a07 Compare November 28, 2022 11:47
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 28, 2022 11:47 Inactive
@johnny-m-young johnny-m-young force-pushed the add-aria-attribute-to-button branch from de89a07 to 3b8d31e Compare November 28, 2022 16:30
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 28, 2022 16:31 Inactive
@johnny-m-young johnny-m-young marked this pull request as ready for review November 29, 2022 09:36
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 29, 2022 09:38 Inactive
Copy link
Contributor

@andysellick andysellick left a comment

Choose a reason for hiding this comment

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

Some minor things, otherwise looks good 👍

CHANGELOG.md Outdated Show resolved Hide resolved
@johnny-m-young johnny-m-young force-pushed the add-aria-attribute-to-button branch from b14a4f5 to 73a6c0a Compare November 29, 2022 10:28
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 29, 2022 10:29 Inactive
@johnny-m-young johnny-m-young changed the title Add aria-controls and aria-describedby options to button component Add aria-controls and aria-describedby options to button component Nov 29, 2022
@johnny-m-young johnny-m-young force-pushed the add-aria-attribute-to-button branch from 73a6c0a to b4cc68a Compare November 29, 2022 10:31
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 29, 2022 10:31 Inactive
@johnny-m-young johnny-m-young changed the title Add aria-controls and aria-describedby options to button component Add aria-controls and aria-describedby attribute options to the button component Nov 29, 2022
This commit adds the aria-controls and aria-describedby
attribute options to the button presenter. This will improve the
usability of the button component for users of screenreaders.
It also adds associated tests.
@johnny-m-young johnny-m-young force-pushed the add-aria-attribute-to-button branch from b4cc68a to a7c6035 Compare November 29, 2022 10:41
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 29, 2022 10:41 Inactive
@govuk-ci govuk-ci temporarily deployed to components-gem-pr-3088 November 29, 2022 11:02 Inactive
@johnny-m-young
Copy link
Contributor Author

@andysellick thanks for the review, I've made the changes you flagged. Could you re-review this?

@johnny-m-young johnny-m-young merged commit 9f09c02 into main Nov 29, 2022
@johnny-m-young johnny-m-young deleted the add-aria-attribute-to-button branch November 29, 2022 14:37
@andysellick andysellick mentioned this pull request Nov 29, 2022
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