File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1313// Used when we need to generate ids for ARIA.
1414var idCounter = 0 ;
1515
16+ function makeHeading ( elem , level ) {
17+ elem . setAttribute ( "role" , "heading" ) ;
18+ elem . setAttribute ( "aria-level" , level ) ;
19+ }
20+
1621function tweakCard ( card ) {
1722 // Make this a focusable list item.
1823 card . setAttribute ( "tabindex" , "-1" ) ;
@@ -48,13 +53,17 @@ function onNodeAdded(target) {
4853 header . setAttribute ( "id" , id ) ;
4954 list . setAttribute ( "aria-labelledby" , id ) ;
5055 // Make the header's container into a heading.
51- header . parentNode . setAttribute ( "role" , "heading" ) ;
52- header . parentNode . setAttribute ( "aria-level" , "2" ) ;
56+ makeHeading ( header , 2 ) ;
5357 }
5458 }
5559 for ( var card of target . querySelectorAll ( ".list-card" ) ) {
5660 tweakCard ( card ) ;
5761 }
62+ for ( var activityCreator of target . querySelectorAll ( ".phenom-creator" ) ) {
63+ // Make the creator of an activity item into a heading
64+ // to facilitate quick jumping between activity items.
65+ makeHeading ( activityCreator , 4 ) ;
66+ }
5867}
5968
6069function onClassModified ( target ) {
Original file line number Diff line number Diff line change @@ -95,6 +95,6 @@ It does the following:
9595 If you are using a screen reader, you will need to ensure that the arrow keys are passed to the application to make use of this.
9696 For NVDA, you can achieve this by switching to focus mode to move through cards.
9797- Labels badges in cards.
98- - Makes list headers accessible as headings.
98+ - Makes list headers and activity item headers accessible as headings.
9999- Prevents loss of position for screen reader users when pressing the control key.
100100- Adds a shift+m keyboard shortcut to quickly move a card.
You can’t perform that action at this time.
0 commit comments