Skip to content

Commit ad4d8d3

Browse files
committed
GitHub: Fix exception.
1 parent 45d8621 commit ad4d8d3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

GitHubA11yFixes.user.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,11 @@ function onSelectMenuItemChanged(target) {
2222
function onDropdownChanged(target) {
2323
target.firstElementChild.setAttribute("aria-haspopup", "true");
2424
var expanded = target.classList.contains("active");
25-
target.children[0].setAttribute("aria-expanded", expanded ? "true" : "false");
25+
target.firstElementChild.setAttribute("aria-expanded", expanded ? "true" : "false");
2626
var items = target.children[1];
27+
if (!items) {
28+
return;
29+
}
2730
if (expanded) {
2831
items.removeAttribute("aria-hidden");
2932
// Focus the first item.

0 commit comments

Comments
 (0)