fix(cdk/a11y): set AriaDescriber messages container to visibility:hidden - #21186
Conversation
crisbeto
left a comment
There was a problem hiding this comment.
The lint check is failing as well.
| // when the description element is not visible. | ||
| messagesContainer.style.visibility = 'hidden'; | ||
| // Even though we use `visibility: hidden`, we still apply `cdk-visually-hidden` so that | ||
| // the description element doesn't impact page layout. |
There was a problem hiding this comment.
You should be able to remove the messagesContainer.setAttribute('aria-hidden', canBeAriaHidden + ''); below since visibility: hidden hides the element from screen readers as well. I'm not sure whether the note about IE and Edge doesn't apply to visibility as well though.
Also the unit tests need to be updated to reflect the new changes.
41f256e to
68c8c22
Compare
crisbeto
left a comment
There was a problem hiding this comment.
LGTM. Can be marked as "merge ready" once the CI issue is fixed.
68c8c22 to
85e519e
Compare
85e519e to
b30dacd
Compare
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Previously searching for AriaDescriber messages in the browser would result in a ctrl-f stop that was invisible. This is because the
cdk-messages-containerhad thecdk-visually-hiddenclass but that is not enough to remove the ctrl-f stops.This fix maintains functionality while preventing extra ctrl-f stops.
Tested with:
macOS/VoiceOver
Windows/NVDA