Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(WIP) Fix description text not read on hover by NVDA #1863

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

matyasf
Copy link
Collaborator

@matyasf matyasf commented Feb 6, 2025

The issue was that NVDA hover mode was not reading form labels because they were set to aria-hidden.
This solution uses aria-labelledby instead, see e.g. https://dequeuniversity.com/library/aria/radio-and-radio-group . Also it no longer reads messages in the beginning, this was not needed

To test:
Check the examples of CheckboxGroup, FormField, RadioInputGroup with NVDA, JAWS, VoiceOver.
NVDA should read the label on hover. Form groups should be announced
There should be no visual change.

Closes: INSTUI-4444

…not read on hover with NVDA

use a span with ARIA tags instead of fieldset

INSTUI-4444
@matyasf matyasf self-assigned this Feb 6, 2025
Copy link

github-actions bot commented Feb 6, 2025

PR Preview Action v1.6.0

🚀 View preview at
https://instructure.github.io/instructure-ui/pr-preview/pr-1863/

Built to branch gh-pages at 2025-02-09 23:32 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

ref={this.handleRef}
>
{this.elementType === 'fieldset' && this.renderLegend()}
Copy link
Collaborator Author

@matyasf matyasf Feb 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old solution used here a fieldset element. SR only reads its <legend> if its the first element. But we use a Grid, so the old solution was to add a <legend> as ScreenReaderContent and use aria-hidden on the visible label.

The new solution uses aria-labelledby instead, so there is just one, visible DOM element for the label

@@ -148,6 +148,7 @@ class CheckboxGroup extends Component<CheckboxGroupProps, CheckboxGroupState> {
vAlign="top"
messagesId={this._messagesId}
elementRef={this.handleRef}
role="group"
Copy link
Collaborator Author

@matyasf matyasf Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes SRs read the same as the fieldset previously

@matyasf matyasf requested review from balzss and ToMESSKa February 7, 2025 15:56
@matyasf matyasf changed the title (WIP) Fix description text not read on hover by NVDA Fix description text not read on hover by NVDA Feb 7, 2025
@matyasf matyasf changed the title Fix description text not read on hover by NVDA (WIP) Fix description text not read on hover by NVDA Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant