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

Remove lists from summary list action links #1956

Merged
merged 3 commits into from
Mar 9, 2021

Conversation

andysellick
Copy link
Contributor

@andysellick andysellick commented Mar 3, 2021

What

Change how the edit/delete links are rendered in the summary list component. They were added inside a list, even if there was only one link. This change only renders the links inside a list if there is more than one of them.

This change applies to the links that can appear at the top of the component as well as the similar links that can appear on each row.

Why

This was highlighted in a recent accessibility audit where only one link was present in a summary list component. A single link (already in a DD element) doesn't need wrapping in a list.

Visual Changes

None. But here's an illustrative screenshot.

Screenshot 2021-03-03 at 20 35 06

Trello card: https://trello.com/c/lNkwruEi/647-fix-accessibility-issues-raised-by-dac

@andysellick andysellick changed the title Remove summary action list Remove lists from summary list action links Mar 3, 2021
@bevanloon bevanloon temporarily deployed to govuk-publis-remove-sum-j0tkku March 3, 2021 20:37 Inactive
@bevanloon bevanloon temporarily deployed to govuk-publis-remove-sum-j0tkku March 3, 2021 20:38 Inactive
@andysellick andysellick requested a review from danacotoran March 3, 2021 20:38
Copy link
Contributor

@danacotoran danacotoran left a comment

Choose a reason for hiding this comment

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

Tested and it looks good to me.
(+ Good call adding tests for the section actions)

edit: {
href: "#edit-title",
data_attributes: {
gtm: "edit-title",
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it makes sense to also check for data attributes when testing that the actions are rendered as a list.
Since there is another test that checks that they're rendered with data attributes when they are alone, is it necessary to also have that in this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good shout, removed.

@andysellick andysellick force-pushed the remove-summary-action-list branch from c5a7f20 to 7d421bd Compare March 9, 2021 09:25
- when the summary list has more than one action i.e. edit and delete, it makes sense for them to be contained within a list inside the DD
- when there is only one action, there is no need for a single item to be contained in a list
- this was raised as an accessibility problem in a recent audit of accounts
- when the summary list has more than one action (at the top of the component) i.e. edit and delete, it makes sense for them to be contained within a list
- when there is only one action, there is no need for a single item to be contained in a list
- add tests for this functionality, as seem to be previously missing
- this was raised as an accessibility problem in a recent audit of accounts
@andysellick andysellick force-pushed the remove-summary-action-list branch from 7d421bd to dc094eb Compare March 9, 2021 09:26
@andysellick andysellick merged commit 0085f57 into master Mar 9, 2021
@andysellick andysellick deleted the remove-summary-action-list branch March 9, 2021 09:32
DilwoarH pushed a commit that referenced this pull request Mar 9, 2021
Includes:
* Remove lists from summary action links ([PR #1956](#1956))
* Fix GOV.UK Frontend deprecation warning for component-guide print stylesheet ([PR #1961](#1961))
* Update search box button ([PR #1957](#1957))
* Adds Reorderable lists component ([PR #1905](#1905))
@DilwoarH DilwoarH mentioned this pull request Mar 9, 2021
This was referenced Mar 11, 2021
This was referenced Mar 11, 2021
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