You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assume the Adaptive Cards has 1+ action buttons (a.k.a. Action.Submit).
After end-user clicked on the action button to submit the Adaptive Card, for accessibility reason, we need to set aria-pressed="true" to indicate user's selection, in PR #3710.
But AC is rendering all actions as role="menuitem" under a container of role="menubar". That means, we are setting aria-pressed="true" to role="menuitem", which is violating WAI-ARIA. Instead, aria-pressed can only applies to role="button" according to WAI-ARIA 1.1.
So, Web Chat turned the role="menuitem" into role="button". But unfortunately, if the Adaptive Card only contains a single action button, the container with role="menubar" will no longer contains anything with role="menuitem", which is violating another rule of WAI-ARIA.
If there are only 1 button in the card, the #container will no longer have any descendants of role="menuitem", which violated a WCAG rule.
Steps to reproduce
Expand to see the test case
<!DOCTYPE html><htmllang="en-US"><head><linkhref="/assets/index.css" rel="stylesheet" type="text/css" /><scriptcrossorigin="anonymous" src="/test-harness.js"></script><scriptcrossorigin="anonymous" src="/test-page-object.js"></script><scriptcrossorigin="anonymous" src="/__dist__/webchat-es5.js"></script></head><body><divid="webchat"></div><script>functioncreateActivity(text){return{from: {role: 'bot'},id: Math.random().toString(36).substr(2,5),
text,timestamp: newDate().toISOString(),type: 'message'};}run(asyncfunction(){constdirectLine=awaittestHelpers.createDirectLineWithTranscript([{attachments: [{contentType: 'application/vnd.microsoft.card.adaptive',content: {$schema: 'http://adaptivecards.io/schemas/adaptive-card.json',type: 'AdaptiveCard',version: '1.3',body: [{type: 'TextBlock',text: 'Hello, World!',size: 'Large',weight: 'Bolder',wrap: true}],actions: [{type: 'Action.Submit',title: 'Okay!'}]}}],from: {id: 'bot',role: 'bot'},id: '1',timestamp: newDate().toISOString(),type: 'message'}]);WebChat.renderWebChat({
directLine,store: testHelpers.createStore(),styleOptions: {autoScrollSnapOnActivity: 1}},document.getElementById('webchat'));awaitpageConditions.uiConnected();awaitpageConditions.numActivitiesShown(1);awaitpageConditions.scrollToBottomCompleted();awaithost.click(document.getElementsByClassName('ac-pushButton')[0]);// EXPECT: All `[role="menubar"]` must have at least one descendant of `[role="menuitem"]`.[].forEach.call(document.querySelectorAll('[role="menubar"]'),menuBar=>{if(!menuBar.querySelectorAll('[role="menuitem"]').length){console.log({ menuBar });thrownewError('One of the element with role="menubar" does not contains any role="menuitem".');}});});</script></body></html>
Expected behavior
All elements with role="menubar" should contains ONE OR MORE descendants of role="menuitem".
Additional context
We might want to remove role="menubar" and all role="menuitem"
We should ask Adaptive Cards team why the actions container and its button have role attribute of menubar and menuitem respectively
[Bug]
The text was updated successfully, but these errors were encountered:
compulim
added
the
bug
Indicates an unexpected problem or an unintended behavior.
label
Jun 15, 2021
Screenshots
Version
4.13.0
(Customer reported on
4.12.0
)Describe the bug
Assume the Adaptive Cards has 1+ action buttons (a.k.a.
Action.Submit
).After end-user clicked on the action button to submit the Adaptive Card, for accessibility reason, we need to set
aria-pressed="true"
to indicate user's selection, in PR #3710.But AC is rendering all actions as
role="menuitem"
under a container ofrole="menubar"
. That means, we are settingaria-pressed="true"
torole="menuitem"
, which is violating WAI-ARIA. Instead,aria-pressed
can only applies torole="button"
according to WAI-ARIA 1.1.So, Web Chat turned the
role="menuitem"
intorole="button"
. But unfortunately, if the Adaptive Card only contains a single action button, the container withrole="menubar"
will no longer contains anything withrole="menuitem"
, which is violating another rule of WAI-ARIA.Before click
Assume there are 2 action buttons.
After click
If there are only 1 button in the card, the
#container
will no longer have any descendants ofrole="menuitem"
, which violated a WCAG rule.Steps to reproduce
Expand to see the test case
Expected behavior
All elements with
role="menubar"
should contains ONE OR MORE descendants ofrole="menuitem"
.Additional context
role="menubar"
and allrole="menuitem"
role
attribute ofmenubar
andmenuitem
respectively[Bug]
The text was updated successfully, but these errors were encountered: