Skip to content

Commit

Permalink
Merge pull request #933 from cagov/fix-page-nav-in-jaws
Browse files Browse the repository at this point in the history
Add tabindex to page-navigation
  • Loading branch information
xjensen committed Sep 26, 2022
2 parents 5e01ab0 + 87417b5 commit d470608
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions components/page-navigation/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Page navigation changelog

## 2.2.1
* Fix anchor linking problem with 2.2.0 in JAWS.

## 2.2.0
* Remove polyfill for smooth scrolling in Safari.

## 2.1.3
* Changes to how styles are inserted into the document.

Expand Down
2 changes: 2 additions & 0 deletions components/page-navigation/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class CAGovPageNavigation extends window.HTMLElement {
headers.forEach((tag) => {
const tagId = tag.getAttribute('id');
const tagName = tag.getAttribute('name');
const tabIndex = tag.getAttribute('tabindex') || '-1';

const title = tag.innerHTML;

Expand Down Expand Up @@ -135,6 +136,7 @@ class CAGovPageNavigation extends window.HTMLElement {

tag.setAttribute('id', anchor);
tag.setAttribute('name', anchor);
tag.setAttribute('tabindex', tabIndex);
});
return `<ul>${output}</ul>`;
}
Expand Down
2 changes: 1 addition & 1 deletion components/page-navigation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cagov/ds-page-navigation",
"version": "2.2.0",
"version": "2.2.1",
"description": "",
"main": "dist/index.js",
"type": "module",
Expand Down
2 changes: 2 additions & 0 deletions components/page-navigation/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class CAGovPageNavigation extends window.HTMLElement {
headers.forEach((tag) => {
const tagId = tag.getAttribute('id');
const tagName = tag.getAttribute('name');
const tabIndex = tag.getAttribute('tabindex') || '-1';

const title = tag.innerHTML;

Expand Down Expand Up @@ -138,6 +139,7 @@ class CAGovPageNavigation extends window.HTMLElement {

tag.setAttribute('id', anchor);
tag.setAttribute('name', anchor);
tag.setAttribute('tabindex', tabIndex);
});
return `<ul>${output}</ul>`;
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d470608

Please sign in to comment.