Bug 28142

Summary: Accessibility: OPAC Cart/basket checkboxes are not labelled
Product: Koha Reporter: Henry Bolshaw <bolshawh>
Component: OPACAssignee: Henry Bolshaw <bolshawh>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: kyle, wainuiwitikapark
Version: MainKeywords: Academy, accessibility
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25240
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00
Circulation function:
Attachments: Bug 28142: Accessibility: OPAC cart/basket checkboxes are not labelled
Bug 28142: Accessibility: OPAC cart/basket checkboxes are not labelled
Bug 28142: Accessibility: OPAC cart/basket checkboxes are not labelled

Description Henry Bolshaw 2021-04-13 12:15:06 UTC
The checkboxes on the OPAC cart ("Basket") pages are not labelled. this makes it hard for users of screen readers to determine their purpose. This applies to both the brief and verbose displays.

e.g. the checkbox appears in NVDA as:

"Unlabeled; check box; not selected"

We should add distinct labels so that users can identify the purpose of the checkboxes without visual context.

The labels should include the title of the item so that users can decide which items to select from a list e.g. "Select [Title]" rather than "Select item".

From what I've read it is better to use <label> with the .sr-only class rather than using aria-label.
Comment 1 Henry Bolshaw 2021-07-15 22:53:17 UTC
Created attachment 122863 [details] [review]
Bug 28142: Accessibility: OPAC cart/basket checkboxes are not labelled

This patch adds labels to the checkboxes on the "Your cart" page to
improve accessibility for users of screen readers. The labels are
hidden from display because the item titles provide enough visual
context.

Test Plan:

1. Go to the OPAC
2. Search for some items and add them to your cart
3. Inspect the page html and confirm the checkboxes are not labelled
4. Select the "More Details" page and confirm these labels are missing too
5. Apply the patch
6. Inspect the checkboxes on the "Brief display" and "more details" views
7. Confirm that the checkboxes have meaningful labels and that the visual
display of the pages has not changed.
Comment 2 Owen Leonard 2021-07-16 12:07:58 UTC
Created attachment 122885 [details] [review]
Bug 28142: Accessibility: OPAC cart/basket checkboxes are not labelled

This patch adds labels to the checkboxes on the "Your cart" page to
improve accessibility for users of screen readers. The labels are
hidden from display because the item titles provide enough visual
context.

Test Plan:

1. Go to the OPAC
2. Search for some items and add them to your cart
3. Inspect the page html and confirm the checkboxes are not labelled
4. Select the "More Details" page and confirm these labels are missing too
5. Apply the patch
6. Inspect the checkboxes on the "Brief display" and "more details" views
7. Confirm that the checkboxes have meaningful labels and that the visual
display of the pages has not changed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Nick Clemens (kidclamp) 2021-08-03 13:08:29 UTC
Created attachment 123421 [details] [review]
Bug 28142: Accessibility: OPAC cart/basket checkboxes are not labelled

This patch adds labels to the checkboxes on the "Your cart" page to
improve accessibility for users of screen readers. The labels are
hidden from display because the item titles provide enough visual
context.

Test Plan:

1. Go to the OPAC
2. Search for some items and add them to your cart
3. Inspect the page html and confirm the checkboxes are not labelled
4. Select the "More Details" page and confirm these labels are missing too
5. Apply the patch
6. Inspect the checkboxes on the "Brief display" and "more details" views
7. Confirm that the checkboxes have meaningful labels and that the visual
display of the pages has not changed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 4 Jonathan Druart 2021-08-04 12:05:56 UTC
Pushed to master for 21.11, thanks to everybody involved!