-
Notifications
You must be signed in to change notification settings - Fork 1
/
2024-accessu.html
912 lines (727 loc) · 37.8 KB
/
2024-accessu.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AccessU 2024: Creating an accessible character counter</title>
<link rel="shortcut icon" href="favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="dist/reveal.css">
<link rel="stylesheet" href="dist/theme/intopia.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'dist/theme/pdf.css' : 'dist/theme/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<div class="menu">
<a href="#/">Start<span class="hidden"> of slide deck</span></a>
</div>
<section data-background="#EDEBEB">
<div class="instructions">
<h3 class="instructions-heading">Slide instructions</h3>
<p><kbd>SPACEBAR</kbd> to <b>move forward</b> through slides.</p>
<p><kbd>SHIFT</kbd> & <kbd>SPACEBAR</kbd> to <b>move backwards</b> through slides.</p>
<p><kbd>LEFT ARROW</kbd> & <kbd>RIGHT ARROW</kbd> to <b>move through sections</b>.</p>
<p><kbd>ESC</kbd> to <b>see overview</b> and <kbd>ESC</kbd> again to exit.</p>
<p><kbd>F</kbd> to <b>enter presentation mode</b> and <kbd>ESC</kbd> to exit.</p>
</div>
</section>
<section data-background="#EDEBEB">
<img class="intopia-logo" src="assets/img/logo-intopia.png" alt="Intopia">
<h1>Creating an accessible character counter</h1>
<div class="subtitle">AccessU 2024</div>
</section>
<!-- –––––––––––––––––––––––––
****** SECTION ******
–––––––––––––––––––––––––– -->
<section id="slide-acknowledgement-of-country">
<section data-background="#EDEBEB">
<h3>Acknowledgement of Country</h3>
</section>
<section data-background="#EDEBEB">
<p>I’d like to acknowledge the <b>Traditional Owners of the lands</b> on which I am running this session today.</p>
</section>
<section data-background="#EDEBEB">
<p>I’d like to pay my respects to <b>Elders past and present</b>, and extend to all First Nations people who are here today or may watch the recording later.</p>
</section>
<section data-background="#EDEBEB">
<p>In my case, I am on the lands of the <a href="https://www.sydneyharbourhighline.org.au/aboriginal-heritage/" target="_blank">Cammeraygal people</a> of the Eora Nation.</p>
</section>
</section>
<!-- –––––––––––––––––––––––––
****** SECTION ******
–––––––––––––––––––––––––– -->
<section id="slide-introductions">
<section data-background="#EDEBEB">
<h3>Some housekeeping</h3>
</section>
<section data-background="#EDEBEB">
<p>My name is <b>Russ Weakley</b>. I am the Head of Inclusive Training and <a href="https://intopia.digital/" target="_blank">Intopia</a>.</p>
</section>
<section data-background="#EDEBEB">
<p>My presentation is <a href="https://intopia.github.io/accessibility-presentations/2024-accessu.html#/" target="_blank">available online</a>, if you want to <b>follow along</b>.</p>
</section>
<section data-background="#EDEBEB">
<p><b>Short link</b>: <code class="font-sm">https://bit.ly/4apIUCK</code></p>
</section>
<section data-background="#EDEBEB">
<p>Use the <kbd>SPACEBAR</kbd> to <b>move through each slide</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>Feel free to <b>ask questions at any time</b> - in chat or in person!</p>
</section>
<section data-background="#EDEBEB">
<p>We’ll also be marking up an example character counter. <b>You can play along if you want</b>!</p>
</section>
<section data-background="#EDEBEB">
<p>We will be using <b>CodePen</b> for the coding activity. You don't need an account to take part.</p>
</section>
</section>
<!-- –––––––––––––––––––––––––
****** SECTION ******
–––––––––––––––––––––––––– -->
<section id="slide-what-is-a-character-counter-component">
<section data-background="#C03C0C">
<h2>What is a character counter?</h2>
</section>
<section data-background="#EDEBEB">
<p>Let's start with the various aspects of a <b>character counter component</b>.</p>
</section>
<section data-background="#EDEBEB">
<img src="assets/img/accessu-2024-01.png" alt="">
</section>
<section data-background="#EDEBEB">
<img src="assets/img/accessu-2024-02.png" alt="">
</section>
<section data-background="#EDEBEB">
<img src="assets/img/accessu-2024-03.png" alt="">
</section>
<section data-background="#EDEBEB">
<img src="assets/img/accessu-2024-04.png" alt="">
</section>
<section data-background="#EDEBEB">
<img src="assets/img/accessu-2024-05.png" alt="">
</section>
<section data-background="#EDEBEB">
<p>As you can see, character counters help people <b>know how much text they can enter</b> when there is a limited number of characters.</p>
</section>
<section data-background="#EDEBEB">
<p>Ideally, these components provide people with <b>live feedback</b> to inform them about the following information:</p>
</section>
<section data-background="#EDEBEB">
<p>1. How many characters <b>they have typed</b> or remain before reaching the limit.</p>
</section>
<section data-background="#EDEBEB">
<p>2. When they <b>reach or exceed</b> the character limit.</p>
</section>
<section data-background="#EDEBEB">
<p>The <a href="https://designsystem.digital.gov/components/character-count/" target="_blank">USWDS character counter</a> is a <b>great example</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>How could we make an <b>accessible character counter component</b>?</p>
</section>
</section>
<!-- –––––––––––––––––––––––––
****** SECTION ******
–––––––––––––––––––––––––– -->
<section id="slide-starting-with-people-and-their-needs">
<section data-background="#C03C0C">
<h2>Starting with people and their needs</h2>
</section>
<section data-background="#EDEBEB">
<p>When creating any new component, it is important to understand how <b>it could impact different types of people</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>I like to group people based on <b>similar needs</b>. For example:</p>
</section>
<section data-background="#EDEBEB">
<ol class="font-sm">
<li>People with <b>varied learning or cognition</b>.</li>
<li>People with <b>reduced colour vision</b>.</li>
<li>People with <b>reduced vision</b>.</li>
<li>People with <b>reduced movement</b>.</li>
<li>People with <b>no vision</b>.</li>
</ol>
</section>
<section data-background="#EDEBEB">
<h4>The order?</h4>
</section>
<section data-background="#EDEBEB">
<p>I prefer to start with people with <b>varied learning or cognition</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>If the component does not work for these people, it has fundamental <b>content or UX issues</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>These issues should be addressed <b>before conducting any other testing</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>I then focus on the people with <b>reduced colour vision</b> and <b>reduced vision</b> for all visual aspects of the component.</p>
</section>
<section data-background="#EDEBEB">
<p>Then, focus on people with <b>reduced movement</b> and <b>no vision</b> for the more technical aspects of the component.</p>
</section>
<section data-background="#EDEBEB">
<p>So, let’s look at these different groups of people and their needs when <b>interacting with a character counter</b>.</p>
</section>
<section data-background="#EDEBEB">
<h4>People with varied learning or cognition</h4>
</section>
<section data-background="#EDEBEB">
<p>In reality, these checkpoints are relevant for <b>all users</b>!</p>
</section>
<section data-background="#EDEBEB">
<p>1. The <b>purpose</b> of the component is clear.</p>
</section>
<section data-background="#EDEBEB">
<p>2. All labels, instructions and error messages are <b>meaningful</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>3. All labels, instructions and error messages are <b>persistent</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>4. If users make a mistake, they can <b>recover quickly</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>5. Users are provided with feedback on <b>the number of characters remaining</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>6. Users are provided with feedback <b>when the character number has been exceeded</b>.</p>
</section>
<section data-background="#EDEBEB">
<h4>Sighted users</h4>
</section>
<section data-background="#EDEBEB">
<p>1. All labels, instructions and error messages are <b>visible</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>2. All labels, instructions and error messages are <b>in close proximity</b> to the relevant form control.</p>
</section>
<section data-background="#EDEBEB">
<p>3. Error and warning messages are <b>distinguishable from other messages</b>.</p>
</section>
<section data-background="#EDEBEB">
<h4>People with reduced colour vision</h4>
</section>
<section data-background="#EDEBEB">
<p>1. All relevant aspects of the component have <b>sufficient colour contrast</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>2. Any information conveyed by colour is <b>accompanied by a visible alternative</b> that does not depend on colour for meaning.</p>
</section>
<section data-background="#EDEBEB">
<h4>People with reduced vision</h4>
</section>
<section data-background="#EDEBEB">
<p>1. The component is operable/understandable when <b>text is scaled</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>2. The component is operable/understandable when the <b>overall layout is scaled</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>3. The component is operable/understandable when <b>aspects of the component are magnified</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>4. The component is operable/understandable when displayed with <b>different text and paragraph spacing</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>5. The component is operable/understandable when <b>displayed in low contrast</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>6. The component is operable/understandable when <b>displayed in different viewport sizes</b>.</p>
</section>
<section data-background="#EDEBEB">
<h4>People with reduced movement</h4>
</section>
<section data-background="#EDEBEB">
<p>1. <b>Focus is managed</b> into, within and out of the component.</p>
</section>
<section data-background="#EDEBEB">
<p>2. Focus order follows a <b>meaningful sequence</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>3. All actions can be <b>executed using keystrokes only</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>4. All actions can be <b>executed using voice controls</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>5. All keystrokes are <b>intuitive</b> for keyboard-only users.</p>
</section>
<section data-background="#EDEBEB">
<p>6. All visible focus states are <b>clearly defined</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>In this case, <b>the component is very simple</b>, so many of these points should be easy to achieve.</p>
</section>
<section data-background="#EDEBEB">
<h4>People with no vision</h4>
</section>
<section data-background="#EDEBEB">
<p>1. The form control has an <b>accessible name</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>2. The form control has a <b>meaningful role</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>3. All relevant labels, instructions and error messages are <b>programmatically associated</b> with the form control.</p>
</section>
<section data-background="#EDEBEB">
<p>4. Users are provided with feedback on <b>the number of characters remaining</b> - at appropriate times.</p>
</section>
<section data-background="#EDEBEB">
<p>5. Users are provided with feedback when <b>the character number has been exceeded</b> - at appropriate times.</p>
</section>
<section data-background="#EDEBEB">
<p>What do we mean by <b>‘appropriate times’</b>? Stay tuned!</p>
</section>
<section data-background="#EDEBEB">
<p>Let’s look at how we could <b>mark up our component</b>.</p>
</section>
</section>
<!-- –––––––––––––––––––––––––
****** SECTION ******
–––––––––––––––––––––––––– -->
<section id="slide-marking-up-the-basic-character-counter">
<section data-background="#C03C0C">
<h2>Marking up the basic character counter</h2>
</section>
<section data-background="#EDEBEB">
<p>For this example, <b>we will not cover</b> detailed JavaScript solutions; we’ll focus on the markup.</p>
</section>
<section data-background="#EDEBEB">
<h5>Play along:</h5>
<ul class="icon-list font-sm">
<li><span aria-hidden="true" class="icon icon-check"></span><a href="https://codepen.io/intopia-training/pen/XWwJYeN" target="_blank">Creating an accessible character counter - start</a></li>
<li><span aria-hidden="true" class="icon icon-check"></span><a href="https://codepen.io/intopia-training/pen/mdYyKBG" target="_blank">Creating an accessible character counter - finished</a></li>
</ul>
</section>
<section data-background="#EDEBEB">
<h4>Viewing the accessibility tree</h4>
</section>
<section data-background="#EDEBEB">
<p>At times during this activity, I will be <b>showing you the accessibility tree</b> using the Chrome browser.</p>
</section>
<section data-background="#EDEBEB">
<div class="col-container">
<div class="col-75">
<p>This <b>accessibility tree</b> consists of information about specific HTML elements, including their:</p>
</div>
<div class="col-25">
<img class="icon-soft" src="assets/icons/tree.svg" alt="">
</div>
</div>
</section>
<section data-background="#EDEBEB">
<ul class="icon-list">
<li><span aria-hidden="true" class="icon icon-check"></span>Name <span class="font-xs success">(e.g. ‘Submit’, ‘Full name’)</span></li>
<li><span aria-hidden="true" class="icon icon-check"></span>Role <span class="font-xs success">(e.g. button, link, textbox)</span></li>
<li><span aria-hidden="true" class="icon icon-check"></span>State <span class="font-xs success">(e.g. checked, expanded, disabled)</span></li>
<li><span aria-hidden="true" class="icon icon-check"></span>Value <span class="font-xs success">(e.g. input from the user)</span></li>
</ul>
</section>
<section data-background="#EDEBEB">
<div class="col-container">
<div class="col-75">
<p><b>Accessibility APIs</b> communicate this information from the accessibility tree to assistive technologies like screen readers.</p>
</div>
<div class="col-25">
<img class="icon-soft" src="assets/icons/cog.svg" alt="">
</div>
</div>
</section>
<section data-background="#EDEBEB">
<p>Each browser supports <a href="https://www.smashingmagazine.com/2015/03/web-accessibility-with-accessibility-api/" target="_blank">different Accessibility APIs</a>, which means they each <b>produce their own unique accessibility tree</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>Let’s have a <a href="https://intopia.github.io/exercise/" target="_blank">quick look</a> at the <b>accessibility tree in Chome</b>.</p>
</section>
<section data-background="#EDEBEB">
<h4>Let’s begin the activity</h4>
</section>
<section data-background="#EDEBEB">
<p>At each step, I will <b>copy and paste the code example</b> into chat.</p>
</section>
<section data-background="#EDEBEB">
<h5>Step 1:</h5>
<p>Add a <code><label></code>:</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><span class="codeHighlight"><label class="label">
Add a comment
</label></span></code></pre>
</section>
<section data-background="#EDEBEB">
<h5>Step 2:</h5>
<p>Add the instructions:</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label">
Add a comment
</label>
<span class="codeHighlight"><span class="help-text">
Enter up to 50 characters
</span></span></code></pre>
</section>
<section data-background="#EDEBEB">
<h5>Step 3:</h5>
<p>Add the <code><textarea></code>:</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label">
Add a comment
</label>
<span class="help-text">
Enter up to 50 characters
</span>
<span class="codeHighlight"><textarea class="input">
</textarea></span></code></pre>
</section>
<section data-background="#EDEBEB">
<h5>Step 4:</h5>
<p>Programmatically associated the label with the <code><textarea></code> using matching <code>for</code> and <code>id</code> values:</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label" <span class="codeHighlight">for="b1"</span>>
Add a comment
</label>
<span class="help-text">
Enter up to 50 characters
</span>
<textarea class="input" <span class="codeHighlight">id="b1"</span>>
</textarea></code></pre>
</section>
<section data-background="#EDEBEB">
<p>The <code><textarea></code> should now have an <b>accessible name</b>.</p>
</section>
<section data-background="#EDEBEB">
<h5>Step 5:</h5>
<p>Programmatically associated the instructions with the <code><textarea></code> using matching <code>aria-describedby</code> and <code>id</code> values:</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label" for="b1">
Add a comment
</label>
<span class="help-text" <span class="codeHighlight">id="a1"</span>>
Enter up to 50 characters
</span>
<textarea class="input" id="b1" <span class="codeHighlight">aria-describedby="a1"</span>>
</textarea></code></pre>
</section>
<section data-background="#EDEBEB">
<p>The <code><textarea></code> should now have an <b>accessible description</b>.</p>
</section>
<section data-background="#EDEBEB">
<h4>Sidenote: the <code>maxlength</code> attribute</h4>
</section>
<section data-background="#EDEBEB">
<p>Some people like to use the <code>maxlength</code> attribute here, to <b>limit the maximum number of characters</b> that users can type into the field.</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label" for="b1">
Add a comment
</label>
<span class="help-text" id="a1">
Enter up to 50 characters
</span>
<textarea class="input" id="b1" aria-describedby="a1"
<span class="codeHighlight">maxlength="50"</span>>
</textarea></code></pre>
</section>
<section data-background="#EDEBEB">
<p>I prefer not to use this method as it will <b>suddenly stop adding chracters</b> when the maximum character length has been reached.</p>
</section>
<section data-background="#EDEBEB">
<p>It will also <a href="https://codepen.io/russweakley/pen/rNgVWeV" target="_blank">stop announcing character input to screen readers</a>, which may be confusing.</p>
</section>
<section data-background="#EDEBEB">
<p>Instead, we will let users keep typing, but inform them that they have <b>exceeded the maximum number of characters</b>.</p>
</section>
<section data-background="#EDEBEB">
<img src="assets/img/accessu-2024-05.png" alt="">
</section>
<section data-background="#EDEBEB">
<h5>Step 6:</h5>
<p>Add an on-screen message character count message:</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label" for="b1">
Add a comment
</label>
<span class="help-text" id="a1">
Enter up to 50 characters
</span>
<textarea class="input" id="b1" aria-describedby="a1">
</textarea>
<span class="codeHighlight"><span class="character-text">
27 characters left
</span></span></code></pre>
</section>
<section data-background="#EDEBEB">
<p>This message is only for sighted users and <b>does not need to be programmatically associated</b> with the form control.</p>
</section>
<section data-background="#EDEBEB">
<p>This on-screen message would be <b>dynamically updated using JavaScript</b> as the user types each new character.</p>
</section>
<section data-background="#EDEBEB">
<p>The on-screen message would also change when the character count limit has been <b>exceeded</b>.</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label" for="b1">
Add a comment
</label>
<span class="help-text" id="a1">
Enter up to 50 characters
</span>
<textarea class="input" id="b1" aria-describedby="a1">
</textarea>
<span class="character-text">
<span class="codeHighlight">5 characters over the limit</span>
</span></code></pre>
</section>
<section data-background="#EDEBEB">
<h4>We have a problem!</h4>
</section>
<section data-background="#EDEBEB">
<p>The problem is that changing this message with each keystroke would be <b>too verbose for screen reader users</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>This dynamic information would be <b>announced over the top of</b> user interaction announcements.</p>
</section>
<section data-background="#EDEBEB">
<p>These people may not be able to hear <b>what characters they are typing</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>So, we need to <b>hide this information</b> from screen readers.</p>
</section>
<section data-background="#EDEBEB">
<h5>Step 7:</h5>
<p>We can ensure this information is not presented to screen readers using <code>aria-hidden="true"</code>.</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label" for="b1">
Add a comment
</label>
<span class="help-text" id="a1">
Enter up to 50 characters
</span>
<textarea class="input" id="b1" aria-describedby="a1">
</textarea>
<span class="character-text" <span class="codeHighlight">aria-hidden="true"</span>>
27 characters left
</span></code></pre>
</section>
<section data-background="#EDEBEB">
<p>This element will now <b>be unavailable</b> in the accessibility tree.</p>
</section>
<section data-background="#EDEBEB">
<h5>Step 8:</h5>
<p>We could then add a screen reader-only message that will be less verbose.</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label" for="b1">
Add a comment
</label>
<span class="help-text" id="a1">
Enter up to 50 characters
</span>
<textarea class="input" id="b1" aria-describedby="a1">
</textarea>
<span class="character-text" aria-hidden="true">
27 characters left
</span>
<span class="codeHighlight"><span>
27 characters left
</span></span></code></pre>
</section>
<section data-background="#EDEBEB">
<h5>Step 9:</h5>
<p>This information can be hidden off-screen so it is only available to screen readers.</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label" for="b1">
Add a comment
</label>
<span class="help-text" id="a1">
Enter up to 50 characters
</span>
<textarea class="input" id="b1" aria-describedby="a1">
</textarea>
<span class="character-text" aria-hidden="true">
27 characters left
</span>
<span <span class="codeHighlight">class="hidden"</span>>
27 characters left
</span></code></pre>
</section>
<section data-background="#EDEBEB">
<p>But how do we make this information <b>‘less verbose’</b>?</p>
</section>
<section data-background="#EDEBEB">
<p>We can use <b>JavaScript Debounce</b> to determine how often the screen reader-only message updates.</p>
</section>
<section data-background="#EDEBEB">
<div class="text-example">
<p><em>Debouncing is a programming technique that helps to improve the performance of web applications by limiting the frequency of function calls.</em></p>
</div>
<p class="font-xxs"><a href="https://dev.to/jeetvora331/javascript-debounce-easiest-explanation--29hc" target="_blank">DEV.TO</a></p>
</section>
<section data-background="#EDEBEB">
<p>In this case, we can use JavaScript to wait for a <b>pause in user typing</b> before updating the screen reader-only message.</p>
</section>
<section data-background="#EDEBEB">
<h5>Step 10:</h5>
<p>We can also set this message with <code>aria-live="polite"</code> so that the information is announced at the next graceful opportunity.</p>
</section>
<section data-background="#222">
<pre><code contenteditable="true"><label class="label" for="b1">
Add a comment
</label>
<span class="help-text" id="a1">
Enter up to 50 characters
</span>
<textarea class="input" id="b1" aria-describedby="a1">
</textarea>
<span class="character-text" aria-hidden="true">
27 characters left
</span>
<span class="hidden" <span class="codeHighlight">aria-live="polite"</span>>
27 characters left
</span></code></pre>
</section>
<section data-background="#EDEBEB">
<p>For these users, the character count information would only be announced <b>when there is a pause in typing</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>Let’s interact with the <a href="https://designsystem.digital.gov/components/character-count/" target="_blank">USWDS character counter</a> using a screen reader.</p>
</section>
</section>
<!-- –––––––––––––––––––––––––
****** SECTION ******
–––––––––––––––––––––––––– -->
<section id="slide-reviewing-our-checklist">
<section data-background="#C03C0C">
<h2>Reviewing our checklist?</h2>
</section>
<section data-background="#EDEBEB">
<p>Let’s recap the <b>points from before</b>.</p>
</section>
<section data-background="#EDEBEB">
<p>Ideally, each point should pass in order for the character counter component <b>to be considered accessible</b>.</p>
</section>
<section data-background="#EDEBEB">
<h4>People with varied learning or cognition</h4>
</section>
<section data-background="#EDEBEB">
<ul class="icon-list font-sm">
<li><span aria-hidden="true" class="icon icon-check"></span>The purpose of the component is clear.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>All labels, instructions and error messages are meaningful.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>All labels, instructions and error messages are persistent.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>If users make a mistake, they can recover quickly.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>Users are provided with feedback on the number of characters remaining.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>Users are provided with feedback when the character number has been exceeded.</li>
</ul>
</section>
<section data-background="#EDEBEB">
<h4>Sighted users:</h4>
</section>
<section data-background="#EDEBEB">
<ul class="icon-list font-sm">
<li><span aria-hidden="true" class="icon icon-check"></span>All labels, instructions and error messages are visible.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>All labels, instructions and error messages are in close proximity to the relevant form control.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>Error and warning messages are distinguishable from other messages.</li>
</ul>
</section>
<section data-background="#EDEBEB">
<h4>People with reduced colour vision</h4>
</section>
<section data-background="#EDEBEB">
<ul class="icon-list font-sm">
<li><span aria-hidden="true" class="icon icon-check"></span>All relevant aspects of the component have sufficient colour contrast.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>Any information conveyed by colour is accompanied by a visible alternative (text, image, etc.) that does not depend on colour for meaning.</li>
</ul>
</section>
<section data-background="#EDEBEB">
<h4>People with reduced vision</h4>
</section>
<section data-background="#EDEBEB">
<p>The component is operable/understandable:</p>
</section>
<section data-background="#EDEBEB">
<ul class="icon-list font-sm">
<li><span aria-hidden="true" class="icon icon-check"></span>When text is scaled to 200%.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>When the overall layout is scaled to 400%.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>When aspects of the component are magnified.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>When displayed in low contrast.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>When displayed in different viewport sizes.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>When displayed with different text and paragraph spacing.</li>
</il>
</section>
<section data-background="#EDEBEB">
<h4>People with reduced movement</h4>
</section>
<section data-background="#EDEBEB">
<ul class="icon-list font-sm">
<li><span aria-hidden="true" class="icon icon-check"></span>Focus managed into, within and out of the component.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>Focus order follows a meaningful sequence.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>All actions can be executed using keystrokes only.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>All actions can be executed using voice controls.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>All keystrokes are intuitive for keyboard-only users.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>All visible focus states are clearly defined.</li>
</ul>
</section>
<section data-background="#EDEBEB">
<h4>People with no vision</h4>
</section>
<section data-background="#EDEBEB">
<ul class="icon-list font-sm">
<li><span aria-hidden="true" class="icon icon-check"></span>The form control has an accessible name.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>The form control has a meaningful role.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>All relevant labels, instructions and error messages are programmatically associated with the form control.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>Users are provided with feedback on the number of characters remaining - at appropriate times.</li>
<li><span aria-hidden="true" class="icon icon-check"></span>Users are provided with feedback when the character number has been exceeded - at appropriate times.</li>
</ul>
</section>
</section>
<!-- –––––––––––––––––––––––––
****** SECTION ******
–––––––––––––––––––––––––– -->
<section id="slide-questions">
<section data-background="#C03C0C">
<h2>Questions or discussion?</h2>
</section>
</section>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/headjs/1.0.3/head.min.js"></script>
<script src="dist/reveal.js"></script>
<script src="plugin/notes/notes.js"></script>
<script>
// More info about initialization & config:
// - https://revealjs.com/initialization/
// - https://revealjs.com/config/
Reveal.initialize({
hash: true,
controls: true,
progress: true,
history: true,
center: true,
transition: 'none',
// Learn about plugins: https://revealjs.com/plugins/
plugins: [ RevealNotes ]
});
</script>
</body>
</html>