From 111d71d980fa9897464621f8063917a454818054 Mon Sep 17 00:00:00 2001 From: Stephanie Leary Date: Wed, 31 May 2023 18:33:34 +0000 Subject: [PATCH] LP1615714 Sandbox: accessible buttons & links Adds several new examples to the Sandbox demonstrating the proper use of ARIA labels and title attributes to create accessible buttons and links, including icons. Also demonstrates four counterexamples, showing why they cause problems for assistive technology users. There is additional commentary in the HTML comments above each button. Signed-off-by: Stephanie Leary --- .../src/app/staff/sandbox/sandbox.component.html | 82 +++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html index fa1dcd01d7..96d53e2ec9 100644 --- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html +++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.html @@ -15,8 +15,88 @@ +
+ + +
+

Accessible Buttons and Icons

+
+
+

Icon only:

+ + +
+ +
+

Icon with text:

+ + +
+ +
+

Icon inline with link text:

+ + + + Edit Settings + +
+ +
+

Icon by itself:

+ + + Error +
+ +
+

Button styled as a link:

+ +
+
+
+
+

Inaccessible examples: what not to do

+
+
+

These buttons cannot be accessed using the keyboard and are announced with the wrong roles:

+ + Mouse users only! + + +
No role!
+
+ +
+

This button is announced as "new underscore releases" (no ARIA label):

+ + +
+ +
+

This button will submit form input on Spacebar or Enter (no type attribute):

+ + +
+
+
+ -
+
-- 2.11.0