Skip to content

Commit 0071f9a

Browse files
authored
Merge pull request #231 from wpaccessibility/add-missing-callout-classes
Fix the most severe a11y issues from audit
2 parents 13d5b20 + 7c9e804 commit 0071f9a

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
</div>
4444
</div>
4545
</div>
46-
<div id="screen-reader-feedback" role="status"></div>
46+
<div id="screen-reader-feedback" role="region" aria-live="polite" aria-atomic="true"></div>
4747
</body>
4848
</html>

assets/js/wp-a11y-docs.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: null
33
---
44

5-
(function (jtd, undefined) {
5+
(function (jtd, undefined) {
66

77
//
88
// ---------------------------------------------------------
@@ -497,15 +497,12 @@
497497
/**
498498
* Scrolls sidebar navigation so the active link is centered.
499499
*
500-
* Also removes the link's `href` to prevent accidental reloads.
501-
*
502500
* @function scrollNav
503501
*/
504502
function scrollNav() {
505503
const targetLink = navLink();
506504
if (targetLink) {
507505
targetLink.scrollIntoView({ block: "center" });
508-
targetLink.removeAttribute('href');
509506
}
510507
}
511508

@@ -530,6 +527,7 @@
530527
}
531528
if (target) {
532529
target.classList.add('active');
530+
target.classList.toggle('active', true);
533531
target = target.parentNode;
534532
}
535533
}
@@ -600,17 +598,17 @@ jtd.onReady(function() {
600598
const input = query;
601599

602600
if (!resultsContainer) return;
603-
601+
604602
// Handle empty search query
605603
if (!query) {
606604
// Check if there was a q parameter but it was empty
607605
if (urlParams.has("q")) {
608606
let pageTitle = document.querySelector('title');
609607
let h1 = document.querySelector('h1');
610-
608+
611609
if (pageTitle) pageTitle.innerText = 'Empty Search Query - No Results';
612610
if (h1) h1.innerText = 'No Search Term Entered';
613-
611+
614612
resultsContainer.innerHTML = '<p>Please enter a search term to find relevant content.</p>';
615613
}
616614
return;

0 commit comments

Comments
 (0)