question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: The WebChat container's role should not always be 'complementary' [screen reader accessibility]

See original GitHub issue

Hi,

Screenshots

Version

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

  1. Go to ‘…’
  2. Click on ‘…’
  3. Scroll down to ‘…’
  4. 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:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
compulimcommented, Jan 29, 2021

It will become:

const ReactWebChat = ({ className, role, ...composerProps }) => (
  <Composer {...composerProps}>
    <BasicWebChat className={className} role={role} />
  </Composer>
);

When end-developer render Web Chat, their call will looks like:

ReactDOM.render(
  <ReactWebChat
    className="my-chat-ui"
    directLine={...}
    role="region"
  />
);
1reaction
compulimcommented, Jan 13, 2021

I think it is better to put role attribute on the <ReactWebChat>, for example:

<ReactWebChat directLine={...} role="region" />

My arguments:

  • We do have dir and disabled attributes too, they are not using style options
  • It seems more natural and intuitive

For composition version of Web Chat, it will be on the <BasicWebChat> component.

<Composer directLine={...}>
  <BasicWebChat role="region" />
</Composer>
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found