Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ return JSON.stringify({
};
}),
screen_reader_classes: captureAndLogError(() => {
return document.querySelectorAll('.sr-only', '.visually-hidden', '.screen-reader-text', '.element-invisible').length > 0;
return document.querySelectorAll('.sr-only', '.visually-hidden', '.screen-reader-text', '.element-invisible', '.sr', '.visuallyhidden', '.skip-link', '.scrn-rdr', '.usa-skipnav', '.usa-sr-only', '.a11y-hide').length > 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little worried about .sr being a little too generic and so resulting in false positive. The rest look fine.

Suggested change
return document.querySelectorAll('.sr-only', '.visually-hidden', '.screen-reader-text', '.element-invisible', '.sr', '.visuallyhidden', '.skip-link', '.scrn-rdr', '.usa-skipnav', '.usa-sr-only', '.a11y-hide').length > 0;
return document.querySelectorAll('.sr-only', '.visually-hidden', '.screen-reader-text', '.element-invisible', '.visuallyhidden', '.skip-link', '.scrn-rdr', '.usa-skipnav', '.usa-sr-only', '.a11y-hide').length > 0;

}),
form_control_a11y_tree: captureAndLogError(() => {
const attributes_to_track_regex = /^(aria-.+|type|id|name|placeholder|accept|autocomplete|autofocus|capture|max|maxlength|min|minlength|required|readonly|pattern|multiple|step)$/i;
Expand Down