microsoft / AdaptiveCards

A new way for developers to exchange card content in a common and consistent way.
https://adaptivecards.io
MIT License
1.72k stars 543 forks source link

{Linked:Bug1654479} [Adaptive Cards > Designer] - Incorrect role as 'Link' is defined for the 'Register and View More' button. #8729

Closed vagpt closed 8 months ago

vagpt commented 8 months ago

Target Platforms

Other

SDK Version

1.6

Application Name

Adaptive Cards

Problem Description

Test Environment: URL: https://adaptivecards.io/designer/ OS Version: 23H2 (OS Build 25977.1000) Browser Version: Version 120.0.2186.2 (Official build) dev (64-bit) Screen Reader: NVDA

Pre-Requisite: Run the below attached JSON file under 'Copy Card Payload editor.'

Repro Steps:

  1. Open the above URL on the EDGE Dev browser.
  2. Run the Json file.
  3. Navigate to the Preview mode and press enter key to activate it.
  4. Press tab key and navigate to the 'Register' and 'View More' button and observe the issue.

Actual Result: Incorrect role as 'Link' is defined for the 'Register and View More' button. Screen Reader is announcing as 'Register Link'.

Expected Result: Correct role as 'Button' should be defined for the 'Register and View More' button. Screen Reader should convey as 'Register Button.'

User Impact: As incorrect role is defined for toggle button, it will create confusion for any screen reader dependent users. If screen reader announces incorrect role, users relying on screen reader would be unable to guess the correct functionality of controls present on the page which prevents the visually disabled users to perform their essential task.

WCAG Reference: https://www.w3.org/WAI/WCAG21/Understanding/name-role-value.html

Have feedback to share on Bugs? Please help fill [Trusted Tester Bug Feedback (office.com)] (https://nam06.safelinks.protection.outlook.com/?url=https://forms.office.com/pages/responsepage.aspx?id%3Dv4j5cvGGr0GRqy180BHbR5dUqGQgJ9lItv-jqY8F09lURVdYTENIRkY2UzlCR0NKV1E2VUE5OVpDVy4u&data=04%7c01%7cv-chisha%40microsoft.com%7c1334b110f98744a7f5df08d968eb842b%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c637656183104980596%7cUnknown%7cTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7c1000&sdata=r4ndSHk/LrBDwzi7FO%2BjKN0DCnqUSUcELBvGRkgc5CU%3D&reserved=0)"

Screenshots

MAS4 1 2-Incorrect role as Link is defined for the Register and View More button

MAS4 1 2-Incorrect role as Link is defined for the Register and View More buttons

Card JSON

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "Container",
            "items": [
                {
                    "type": "TextBlock",
                    "size": "large",
                    "text": "Our recommendation for you!",
                    "color": "accent",
                    "wrap": true
                },
                {
                    "type": "TextBlock",
                    "text": "Based on your organizational needs",
                    "wrap": true
                }
            ]
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "TextBlock",
                    "text": "[Microsoft Azure Administrator]()",
                    "weight": "Bolder",
                    "wrap": true
                },
                {
                    "type": "RichTextBlock",
                    "inlines": [
                        {
                            "type": "TextRun",
                            "text": "Date: "
                        },
                        {
                            "type": "TextRun",
                            "text": "Dec 04, 2023 - Dec 29, 2023",
                            "weight": "Bolder"
                        }
                    ]
                },
                {
                    "type": "RichTextBlock",
                    "inlines": [
                        {
                            "type": "TextRun",
                            "text": "Time: "
                        },
                        {
                            "type": "TextRun",
                            "text": "09:00 AM - 05:00 PM (GMT+01:00) Brussels, Copenhagen, Madrid, Paris",
                            "weight": "Bolder"
                        }
                    ]
                },
                {
                    "type": "RichTextBlock",
                    "inlines": [
                        {
                            "type": "TextRun",
                            "text": "Language: "
                        },
                        {
                            "type": "TextRun",
                            "text": "English",
                            "weight": "Bolder"
                        }
                    ]
                },
                {
                    "type": "RichTextBlock",
                    "inlines": [
                        {
                            "type": "TextRun",
                            "text": "Delivery ID: "
                        },
                        {
                            "type": "TextRun",
                            "text": "36877",
                            "weight": "Bolder"
                        }
                    ]
                },
                {
                    "type": "ActionSet",
                    "actions": [
                        {
                            "type": "Action.OpenUrl",
                            "title": "Register ",
                            "label": "Register link opens in a new tab",
                            "url": "#"
                        }
                    ]
                }
            ]
        }
    ],
    "actions": [
        {
            "type": "Action.OpenUrl",
            "title": "View More \uF35F",
            "url": "#"
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.3"
}

Sample Code Language

No response

Sample Code

No response

anna-dingler commented 8 months ago

Hi @vagpt,

This can be fixed in the card payload, so I am closing this bug.

Actions now have a property role where card authors can define the role announced by Narrator. Adding "role": "button" to each of the actions will resolve this issue.

Additionally, these buttons are defined as links by default since the action type is "OpenUrl" which implies that a new page will be launched. Either way, card authors can override this default as mentioned above.

Hope this helps and let me know if you have any questions!

Thanks, Anna