Skip to content

Commit 68c5e87

Browse files
crisbetoamysorto
authored andcommitted
fix(material/select): empty space read out by VoiceOver on Chrome (#24741)
We use an empty space to prevent the select from collapsing when it doesn't have a value, but the approach we were using was being read out as a blank space by VoiceOver on Chrome. These changes switch to using `visibility: hidden` so that it isn't read out. Fixes #24731. (cherry picked from commit 333f3a4)
1 parent 6c65b1d commit 68c5e87

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/material-experimental/mdc-select/select.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ $scale: 0.75 !default;
171171
content: ' ';
172172
white-space: pre;
173173
width: 1px;
174-
175-
// Prevents some browsers from rendering the element in high contrast mode.
176174
display: inline-block;
177-
opacity: 0;
175+
176+
// Prevents some browsers from rendering the element in high contrast mode. Use `visibility`
177+
// instead of `opacity` since VoiceOver + Chrome still reads out the space with the latter.
178+
visibility: hidden;
178179
}

src/material/select/select.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,9 @@ $placeholder-arrow-space: 2 * ($arrow-size + $arrow-margin);
167167
content: ' ';
168168
white-space: pre;
169169
width: 1px;
170-
171-
// Prevents some browsers from rendering the element in high contrast mode.
172170
display: inline-block;
173-
opacity: 0;
171+
172+
// Prevents some browsers from rendering the element in high contrast mode. Use `visibility`
173+
// instead of `opacity` since VoiceOver + Chrome still reads out the space with the latter.
174+
visibility: hidden;
174175
}

0 commit comments

Comments
 (0)