Skip to content

Commit 333f3a4

Browse files
authored
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.
1 parent 8fee9a7 commit 333f3a4

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
@@ -170,8 +170,9 @@ $scale: 0.75 !default;
170170
content: ' ';
171171
white-space: pre;
172172
width: 1px;
173-
174-
// Prevents some browsers from rendering the element in high contrast mode.
175173
display: inline-block;
176-
opacity: 0;
174+
175+
// Prevents some browsers from rendering the element in high contrast mode. Use `visibility`
176+
// instead of `opacity` since VoiceOver + Chrome still reads out the space with the latter.
177+
visibility: hidden;
177178
}

src/material/select/select.scss

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

0 commit comments

Comments
 (0)