bug: The WebChat container's role should not always be 'complementary' [screen reader accessibility]
See original GitHub issueHi,
- Relates to :~ #3655.
Screenshots
Version
- WebChat.js version :~ 4.10.1;
- JS :~ https://cdn.botframework.com/botframework-webchat/4.10.1/webchat.js;
Describe the bug
Sometimes a Chat-bot will be additional content on the Web-page, set apart from the main
content. However, other times a Chat-bot will be the only or main focus of the Web-page.
In these cases role=complementary
is not appropriate, and will confuse screen reader users, who may rely on landmark roles for navigation.
Steps to reproduce
- Go to ‘…’
- Click on ‘…’
- Scroll down to ‘…’
- See error
Expected behavior
Give implementors / developers the option to modify the container-role via defaultStyleOptions.js:
containerRole: 'complementary', // WAI-ARIA landmark role. Suggestions: 'complementary' or 'region'. Defaults to 'complementary'.
The value would be used in :~ https://github.com/microsoft/BotFramework-WebChat/blob/v4.11.0/packages/component/src/BasicWebChat.js#L71;
For example, role={containerRole}
:
return (
<AccessKeySinkSurface ... ... >
<TypeFocusSinkBox
className={sinkClassName}
disabled={disabled}
ref={transcriptFocusRef}
role={containerRole}
sendFocusRef={sendBoxFocusRef}
>
// ...
</TypeFocusSinkBox>
</AccessKeySinkSurface>
);
Please let me know what you think of this proposal.
Yours,
Nick
Additional context
[Bug]
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
ARIA: alert role - Accessibility - MDN Web Docs - Mozilla
The alert role should only be used for text content, not interactive elements such as links or buttons. The element with the alert...
Read more >The Roles Model | Accessible Rich Internet Applications (WAI ...
Roles are element types and authors MUST NOT change role values over time or ... The label is needed by a screen reader...
Read more >Creating Accessible Menus and Mega Menus - Level Access
Some address historical accessibility issues with screen reader support. ... The accessible role of an element does not have to always match ...
Read more >Accessibility Training - Accessing Higher Ground
ARIA can correct this by provides the role and state properties ... The screen reader user does not know which is which; Solution:...
Read more >Introduction to ARIA - Accessible Rich Internet Applications
Default HTML roles should not be duplicated using ARIA—avoid things ... Screen readers provide a list of all landmarks/regions on a page and ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It will become:
When end-developer render Web Chat, their call will looks like:
I think it is better to put
role
attribute on the<ReactWebChat>
, for example:My arguments:
dir
anddisabled
attributes too, they are not using style optionsFor composition version of Web Chat, it will be on the
<BasicWebChat>
component.