Skip to content

Commit e8b9e34

Browse files
committed
Slack: Fix the role on the message entry text box.
It was previously a textarea, but now it's a contentEditable div. Slack does set the role, but they incorrectly set it to textarea instead of textbox.
1 parent 60776d8 commit e8b9e34

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

SlackA11yFixes.user.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ function onNodeAdded(target) {
8181
elem.setAttribute("role", "heading");
8282
elem.setAttribute("aria-level", "2");
8383
}
84+
// The message editor is a contentEditable div.
85+
// Slack does set the role, but to an invalid value of "textarea".
86+
if (elem = document.querySelector(".ql-editor"))
87+
elem.setAttribute("role", "textbox");
8488
}
8589

8690
function onClassModified(target) {

0 commit comments

Comments
 (0)