Skip to content

Commit 2f16f84

Browse files
committed
Address feedback from AWS accessibility
1 parent 1d71f6e commit 2f16f84

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

templates/default/fulldoc/html/css/style.css

+10-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ body {
8585
@media (max-width: 320px) {
8686
body { height: 100%; overflow: hidden; overflow-wrap: break-word; }
8787
#main { height: 100%; overflow: auto; }
88-
#search { display: none; }
8988
}
9089

9190
#main img { max-width: 100%; }
@@ -389,6 +388,16 @@ ul.fullTree li:last-child { padding-bottom: 0; }
389388
text-align: center;
390389
}
391390

391+
.visually-hidden {
392+
position: absolute;
393+
top: auto;
394+
overflow: hidden;
395+
clip: rect(1px, 1px, 1px, 1px);
396+
width: 1px;
397+
height: 1px;
398+
white-space: nowrap;
399+
}
400+
392401
#menu { font-size: 1.3em; color: #bbb; }
393402
#menu .title, #menu a { font-size: 0.7em; }
394403
#menu .title a { font-size: 1em; }

templates/default/fulldoc/html/js/full_list.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function enableSearch() {
108108
}
109109
});
110110

111-
$('#full_list').after("<div id='noresults' role='status' style='display:none'></div>");
111+
$('#full_list').after("<div id='noresults' role='status' style='visually-hidden'></div>");
112112
}
113113

114114
function ignoredKeyPress(event) {
@@ -136,7 +136,7 @@ function clearSearch() {
136136
function performSearch(searchString) {
137137
clearSearchTimeout();
138138
$('#full_list, #content').addClass('insearch');
139-
$('#noresults').text('').hide();
139+
$('#noresults').text('').addClass('visually-hidden');
140140
partialSearch(searchString, 0);
141141
}
142142

@@ -173,11 +173,12 @@ function searchDone() {
173173
highlight();
174174
var found = $('#full_list li:visible').size();
175175
if (found === 0) {
176-
$('#noresults').text('No results were found.').hide().fadeIn();
176+
$('#noresults').text('No results were found.');
177177
} else {
178178
// This is read out to screen readers
179-
$('#noresults').text('There are ' + found + ' results.').hide().fadeIn();
179+
$('#noresults').text('There are ' + found + ' results.');
180180
}
181+
$('#noresults').removeClass('visually-hidden');
181182
$('#content').removeClass('insearch');
182183
}
183184

templates/default/fulldoc/html/setup.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def class_list(root = Registry.root, tree = TreeContext.new)
232232
out << "<li id='object_#{child.path}' class='#{tree.classes.join(' ')}'>"
233233
out << "<div class='item' style='padding-left:#{tree.indent}'>"
234234
accessible_props = "aria-label='#{name} child nodes' aria-expanded='false' aria-controls='object_#{child.path}'"
235-
out << "<a tabindex='0' class='toggle' #{accessible_props}></a> " if has_children
235+
out << "<a tabindex='0' class='toggle' role='button' #{accessible_props}></a> " if has_children
236236
out << linkify(child, name)
237237
out << " &lt; #{child.superclass.name}" if child.is_a?(CodeObjects::ClassObject) && child.superclass
238238
out << "<small class='search_info'>"

0 commit comments

Comments
 (0)