Skip to content

Commit

Permalink
fix: Modify screen-reader-only class to improve Orca's reading behavi…
Browse files Browse the repository at this point in the history
…or (#4901)

#### Details
Currently, we use a screen-reader-only class that makes elements offscreen and 1px x 1px. Unfortunately, shortening the element's width to 1px causes the Orca screen reader to behave in an undesirable manner wherein it reads one word at a time and re-reads the element type with each word. To fix this, this PR removes width: 1px from the screen-reader-only class. Instead, clip-path is used to ensure the element is not visible.

##### Motivation
Addresses accessibility issue in AI-Android (and AI-Web) on Linux.

##### Context
I considered simply eliminating width since the class already sets left:-10000px, but decided to add the clip-path as a redundancy. 

This should have no visible impact and no impact to other screen readers' behavior.

#### Pull request checklist
<!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox -->
- [x] Addresses an existing issue: ADO 1886155
- [x] Ran `yarn fastpass`
- [x] Added/updated relevant unit test(s) (and ran `yarn test`)
- [x] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage`
- [x] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`.
- [n/a] (UI changes only) Added screenshots/GIFs to description above
- [x] (UI changes only) Verified usability with NVDA/JAWS
  • Loading branch information
jalkire authored Nov 19, 2021
1 parent 8c99d9c commit 377a736
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.check-container svg {
width: 100%;
Expand Down Expand Up @@ -622,9 +622,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.report-footer-container {
max-width: 960px;
Expand Down Expand Up @@ -939,9 +939,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.how-to-fix-content--OHBLC {
margin-bottom: 16px;
Expand Down Expand Up @@ -1467,9 +1467,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
</style></head
><body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.check-container svg {
width: 100%;
Expand Down Expand Up @@ -622,9 +622,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.report-footer-container {
max-width: 960px;
Expand Down Expand Up @@ -939,9 +939,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.how-to-fix-content--OHBLC {
margin-bottom: 16px;
Expand Down Expand Up @@ -1467,9 +1467,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
</style></head
><body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.check-container svg {
width: 100%;
Expand Down Expand Up @@ -622,9 +622,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.report-footer-container {
max-width: 960px;
Expand Down Expand Up @@ -939,9 +939,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.how-to-fix-content--OHBLC {
margin-bottom: 16px;
Expand Down Expand Up @@ -1467,9 +1467,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
</style></head
><body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.check-container svg {
width: 100%;
Expand Down Expand Up @@ -622,9 +622,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.report-footer-container {
max-width: 960px;
Expand Down Expand Up @@ -939,9 +939,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.how-to-fix-content--OHBLC {
margin-bottom: 16px;
Expand Down Expand Up @@ -1467,9 +1467,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
</style></head
><body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.check-container svg {
width: 100%;
Expand Down Expand Up @@ -622,9 +622,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.report-footer-container {
max-width: 960px;
Expand Down Expand Up @@ -939,9 +939,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.how-to-fix-content--OHBLC {
margin-bottom: 16px;
Expand Down Expand Up @@ -1467,9 +1467,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
</style></head
><body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.check-container svg {
width: 100%;
Expand Down Expand Up @@ -622,9 +622,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.report-footer-container {
max-width: 960px;
Expand Down Expand Up @@ -939,9 +939,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.how-to-fix-content--OHBLC {
margin-bottom: 16px;
Expand Down Expand Up @@ -1467,9 +1467,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
</style></head
><body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,9 +400,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.check-container svg {
width: 100%;
Expand Down Expand Up @@ -622,9 +622,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.report-footer-container {
max-width: 960px;
Expand Down Expand Up @@ -939,9 +939,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
.how-to-fix-content--OHBLC {
margin-bottom: 16px;
Expand Down Expand Up @@ -1467,9 +1467,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
</style></head
><body
Expand Down
2 changes: 1 addition & 1 deletion src/common/components/cards/fix-instruction-color-box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ span.fix-instruction-color-box {
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
2 changes: 1 addition & 1 deletion src/common/components/fix-instruction-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
}
2 changes: 1 addition & 1 deletion src/reports/components/outcome.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}

$outcome-pass-color: $positive-outcome;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
position: absolute;
left: -10000px;
top: auto;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(100% 100% 100% 100%);
}
}

0 comments on commit 377a736

Please sign in to comment.