-
Notifications
You must be signed in to change notification settings - Fork 55
fix(Accessibility): Remove role="presentation" from chatMessageBehavior and FocusZone #530
Conversation
…chatMessageBehavior
Codecov Report
@@ Coverage Diff @@
## master #530 +/- ##
=======================================
Coverage 88.17% 88.17%
=======================================
Files 42 42
Lines 1455 1455
Branches 212 187 -25
=======================================
Hits 1283 1283
Misses 167 167
Partials 5 5 Continue to review full report at Codecov.
|
* Sets the message to be a focusable element. | ||
* Adds a vertical circular focus zone navigation where a user navigates using a Tab key. | ||
* Adds a key action which prevents up and down arrow keys from navigating in FocusZone, we only want a Tab key to navigate. | ||
*/ | ||
const chatMessageBehavior: Accessibility = (props: any) => ({ | ||
attributes: { | ||
root: { | ||
role: 'presentation', | ||
role: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be removed altogether then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a good question, I was also considering that.
@jurokapsiar, do you think this role=presentation
to be set by default in FocusZone? We always can add in behavior in cases where we need it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After discussion with @jurokapsiar, we decided to remove that attribute from FocusZone. Thank you Roman, for raising this question, it always good to have someone to look at the situation with a fresh eye :)
So this attribute is added in the original FocusZone in fabric-ui, and they have some reasons for that, but we don't see the need for it right now, as in most cases we control role
in behaviors.
Will update the PR
After testing chat with multiple screen readers, we figured out that no
role
should be assigned to Chat message. SinceFocusZone
setsrole=presentation
to container by default, I override it inchatMessageBehavior
by settingrole=undefined