Skip to content

Commit 1f13d60

Browse files
authored
docs(material/form-field): update form-field prefix suffix a11y docs (#33680)
Updates Form Field components' documentation on accessibility when using matTextPrefix and matTextSuffix by recommending usage of aria-label or aria-describedby to ensure full context is provided for screen readers. Fixes b/517657863
1 parent 5fcd952 commit 1f13d60

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/material/form-field/form-field.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,18 @@ adds these elements' IDs to the control's `aria-describedby` attribute. Addition
144144
applies `aria-live="polite"` by default such that assistive technology will announce errors when
145145
they appear.
146146

147+
When using static text prefixes or suffixes (such as currency symbols like `$` or unit suffixes like
148+
`.00` or `kg`), screen readers may not announce them as part of the input value, and some mobile screen
149+
readers, especially on Android/TalkBack, may expose them as separate focus stops. This can lead to
150+
redundant announcements or unexpected focus behavior when navigating the field.
151+
152+
If the prefix or suffix provides important context, add an `aria-label` to the input or include the full
153+
meaning in `aria-describedby` so the accessible name/description matches the visible content. For example,
154+
if the prefix is `$` and the suffix is `.00` to indicate dollars with no cents, an appropriate `aria-label`
155+
could be `aria-label="Amount in dollars with 0 cents"`. When the static text is purely decorative and the
156+
input already conveys the full context, add `aria-hidden="true"` to the static `matTextPrefix` or
157+
`matTextSuffix` elements so they are skipped during swipe navigation and do not create redundant focus stops.
158+
147159
### Troubleshooting
148160

149161
#### Error: A hint was already declared for align="..."

0 commit comments

Comments
 (0)