Skip to content

Commit 45d8621

Browse files
committed
GitHub: Make suggestions accessible as checkable menu items for "Request a Review" in pull requests.
1 parent c4a6e55 commit 45d8621

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

GitHubA11yFixes.user.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,14 @@ function onNodeAdded(target) {
102102

103103
// Site-wide stuff.
104104
// Checkable menu items; e.g. in watch and labels pop-ups.
105-
for (elem of target.querySelectorAll(".select-menu-item")) {
106-
elem.setAttribute("role", "menuitemcheckbox");
107-
onSelectMenuItemChanged(elem);
105+
if (target.classList.contains("select-menu-item")) {
106+
target.setAttribute("role", "menuitemcheckbox");
107+
onSelectMenuItemChanged(target);
108+
} else {
109+
for (elem of target.querySelectorAll(".select-menu-item")) {
110+
elem.setAttribute("role", "menuitemcheckbox");
111+
onSelectMenuItemChanged(elem);
112+
}
108113
}
109114
// Table lists; e.g. in issue and commit listings.
110115
for (elem of target.querySelectorAll(".table-list,.Box-body,ul.js-navigation-container"))

0 commit comments

Comments
 (0)