Skip to content

Commit 2101156

Browse files
committed
Trello: Hack to prevent loss of position for screen reader users when pressing the control key.
Pressing control focuses a contentEditable div for clipboard stuff, but this causes screen reader users to lose their position. For now, just remove focus from this element. This will still focus the document, but it should be less annoying than focusing an editable text control.
1 parent 3057a37 commit 2101156

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

TrelloA11yFixes.user.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ function onNodeAdded(target) {
3333
target.setAttribute("aria-label", label);
3434
return;
3535
}
36+
if (target.id == "clipboard") {
37+
// Pressing control focuses a contentEditable div for clipboard stuff,
38+
// but this causes screen reader users to lose their position.
39+
target.blur();
40+
return;
41+
}
3642
for (var list of target.querySelectorAll(".list")) {
3743
list.setAttribute("role", "list");
3844
var header = list.querySelector(".list-header-name");

readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,4 @@ It does the following:
9696
For NVDA, you can achieve this by switching to focus mode to move through cards.
9797
- Labels badges in cards.
9898
- Makes list headers accessible as headings.
99+
- Prevents loss of position for screen reader users when pressing the control key.

0 commit comments

Comments
 (0)