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

a11y: make SR read field descriptions on widgets #2281

Merged
merged 9 commits into from
Mar 22, 2020

Conversation

beyackle
Copy link
Contributor

@beyackle beyackle commented Mar 16, 2020

Description

This replaces the IconButton in WidgetLabel.tsx with an ordinary Icon. The properties were copied over for the most part, except for some needed adjustment to the margins. One odd note here is that the screen reader's focus rectangle goes onto the editor field when reading the help text instead of the icon itself, but I think the behavior is basically correct as far as the SR experience goes.

Task Item

Closes #2115
Closes #2063

Screenshots

image

Replaces the IconButton in WidgetLabel.tsx with a plain Icon bearing an aria-label.
@beyackle beyackle requested a review from boydc2014 as a code owner March 16, 2020 17:37
}}
aria-labelledby={`${id}-description`}
aria-label={
// append a semicolon so the screen-reader pauses instead of making a confusing run-on
Copy link
Contributor

Choose a reason for hiding this comment

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

🤩

Copy link
Contributor

Choose a reason for hiding this comment

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

Neat trick.

corinagum
corinagum previously approved these changes Mar 16, 2020
@beyackle
Copy link
Contributor Author

Just failing a unit test. I'll fix that and get it back up.

@beyackle
Copy link
Contributor Author

It looks like this PR fixes another issue too (#2063), so I'll link that here too.

@github-actions
Copy link

Coverage Status

Coverage remained the same at 40.95% when pulling 4396c4b on beyackle/srWidgetLabelIcon into 97b9698 on master.

Copy link
Contributor

@a-b-r-o-w-n a-b-r-o-w-n left a comment

Choose a reason for hiding this comment

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

I'm a little confused by what you said in the description. Can a keyboard-only user still trigger the tooltip?

}}
aria-labelledby={`${id}-description`}
aria-label={
// append a semicolon so the screen-reader pauses instead of making a confusing run-on
Copy link
Contributor

Choose a reason for hiding this comment

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

Neat trick.

@beyackle
Copy link
Contributor Author

Okay, verified that these aren't keyboard-navigable now. I'll fix that quickly and put up another version.

beyackle and others added 2 commits March 17, 2020 15:29
Add a keyboard tab stop and adjust spacing - still not sure the SR experience is 100% great, but this at least makes it work.
@beyackle
Copy link
Contributor Author

Still not 100% happy with the SR experience here, but I think this addresses all the issues.

Copy link
Contributor

@a-b-r-o-w-n a-b-r-o-w-n left a comment

Choose a reason for hiding this comment

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

A problem with this is that the focus styles might not match the other elements, so maybe the best approach is using the button.

@beyackle
Copy link
Contributor Author

The original ticket specifically complained about the SR reading "button" when there isn't anything to click on, so we can't leave it a button.

@a-b-r-o-w-n
Copy link
Contributor

Maybe the Fabric team has some guidance on this? I'll send you a link to their channel.

@cwhitten cwhitten merged commit d2a2ab9 into master Mar 22, 2020
@cwhitten cwhitten deleted the beyackle/srWidgetLabelIcon branch March 22, 2020 17:14
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* replace IconButton with Icon

Replaces the IconButton in WidgetLabel.tsx with a plain Icon bearing an aria-label.

* fix unit tests

* Update WidgetLabel.tsx

Add a keyboard tab stop and adjust spacing - still not sure the SR experience is 100% great, but this at least makes it work.

Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants