AdaptiveCards icon indicating copy to clipboard operation
AdaptiveCards copied to clipboard

{Linked:Bug2612439}[Accessibility]Voice Over does not convey the role as ‘Button’ for selectAction button.

Open kaichun-wu opened this issue 4 years ago • 1 comments

Target Platforms

iOS

SDK Version

2.8.7

Application Name

Microsoft Teams

Problem Description

Test Environment: Device: iPhone 12 Software Version: 15.6.1 App name: Teams App version: 4.15.1 build-4.15.77.2022153904/0826(General) User Account: [email protected] Screen Reader: Voice Over

Repro Steps: Turn on Voice Over. Launch MS teams and login with valid credentials. Navigate to the 'Voice Assistance' button and activate it. Give 'Join My Next Metting' command to Cortana. Cortana will respond with all the upcoming next meetings. Navigate to "Change Meeting Settings" button using swipe gesture and verify screen reader announcement. Actual Result: Role is not defined for the "Change Meeting Settings" button. Voice Over does not convey the role as ‘Button’ for ‘Change Meeting Settings' button.

Expected Result: Role as button should be defined for the "Change Meeting Settings" button. Voice Over announce should as ‘Change Meeting Settings button'.

Note: 'Change Meeting Settings' button is not accessible using Bluetooth keyboard 'Ctrl + Tab' key. Same issue is repro on 'Show More' button on 'Open Which File??' page with 'Open my recent file' command.

User Experience: When interactive elements do not have role property, it is difficult for people using assistive technology (like screen readers) to understand the functionality of control and its relationship to other content.

MAS Reference: Name, Role, Value - Liquid (microsoft.com)

Bug Feedback: Have feedback to share on Bugs? Please help fill Trusted Tester Bug Feedback (office.com)

Screenshots

In Teams the selectAction didn't announce Button as role. IMG_0699

And when using Adaptive Card App: ADCIOSVisualizer, it will announce the description twice. Seems as Android bug: issue #8025 IMG_0698

Card JSON

{
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.4",
    "body": [
        {
            "type": "Container",
            "items": [
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "stretch",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "size": "Large",
                                    "text": "test color",
                                    "wrap": true,
                                    "maxLines": 2,
                                    "spacing": "Medium"
                                },
                                {
                                    "type": "TextBlock",
                                    "isSubtle": true,
                                    "text": "Today,  2:30 PM - 3:00 PM",
                                    "spacing": "None"
                                }
                            ]
                        }
                    ]
                }
            ]
        },
        {
            "type": "Container",
            "items": [
                {
                    "type": "TextBlock",
                    "size": "Medium",
                    "isSubtle": true,
                    "text": "Meeting settings",
                    "spacing": "None"
                },
                {
                    "type": "ColumnSet",
                    "columns": [
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJrSURBVHgB1ZnhcdowGIZfqVyvP+kGjJBOAF2jTYI7QicoTFA6QdWE3PVfmglCNmAEdwP/aH7FWP0+J5dziGwkbEvykwsHssQ9r/3ZRpbAwEiSZIIiv6a3E2i9FBgQj/IPt4CYPDVlEgPBIE/obBBHoEY+hdx9jD5Ak7xSv9OoAxyS50/i9aDTGXZ6DiFn1HmCbtmiKO4wertSSqVNHW3kGVEZMMaOLk8CM/hhoS7WS9MGW3lG1A/oHwGd/Ly4+lVts5FPzk+/0ZF8z0dyVG7PHxaQ1QE+0Fst72+qLYfkn6sEVCWS7gBFPhVlzRe4hVf0FvKepP5ksJc/oe3X+1UikesEXnGX/3L+eU5721jikv6m8MYRe35+9l1DKGocm75R0Amh4QU3eeBdZnNVHMELzvLjcpuobjPj4cecm7wo3kzr6t1EzwHca76p3k30GMBWHnxH2+zfYW3pKYCDfEt6COBPnuk4gF95psMA/uWZjgKEkWc6CBBOnmkZIKw80yJAeHnmyABxyDNHBIhHnnEMEJc84xAgPnnGMkCc8oxFgHjlmQMBAshr/ZVeM9vuDQHC7Hl1ebWCzD+UkxwLagKELZtycsNzY43Nob4UQKQvm0KUjfi738Qh1OWaJvhYNg3l53N3lW8Ks+eL+j1ND4AXTeeFRFFOohGubHSq1utNU4+m80I+Df4Rqubp8fjCpp/5vNDmFRqPJ+yyLBFHkrNPCSU/gSxWhhUaL/IZr/GWpdGSFwF6lufyTOn/BvLfqlqubaguMVkv68REwxJT/PKMGLI8I4csz/BPicqT4GHJM5IvZ3i8QmyHJs/8B3OjcjOBk8MRAAAAAElFTkSuQmCC",
                                    "horizontalAlignment": "Center",
                                    "altText": "camera",
                                    "width": "12px",
                                    "height": "12px"
                                }
                            ],
                            "verticalContentAlignment": "Center"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "size": "Small",
                                    "isSubtle": true,
                                    "text": "Video is off",
                                    "spacing": "None"
                                }
                            ],
                            "verticalContentAlignment": "Center",
                            "spacing": "Small"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "Image",
                                    "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAPDSURBVHgB7Zm9UttAFIXPSoY25gnivEBwmS72EwS6DEMS0SUVblMBTxDcpUOAJ0MX6NIBT4CcpEiH3gBnJswwWNbmruQfCWullbRykpl8DWht756jvXv3j0ETlmXV4Xvb4GiBoUlF9fFHDnz/ErXlfdu2XWiGQQPW680d+tPBTHQynNswl/Z0GillgN56A/7wM1XTVP8Vd2EstXWZMFCG3OIFTJg+D8xroLCBMGzyip/AGhh5B9BAoRAKQ8e7Rll8tO1e7yKxjVcbFiWEZtbgL9YDo+EadMCwk1Qc9C4zDmAY2/SiroIMJ6FgCLEXqIhxRtuNFJH4+4bs+zUUIczzJeEOzNv1aEmCeEHXtj85slqKDuI6SkHijVtKpaeDSYlE/KF91Ouk1VQujRYil3grq7YFG9ArXrBAA/rFCxZkoBrxggUYqE68oGID1YoXVGigevGCigwoixfrIRslqMBADvEa0GxgseIFGg0sXrxAupgLl7AjWjabF9nbP33i87Wb1gP+8Ao+PwjW4xsbKatPzW9eud2QRAOWtdkKtn0hdZimpCK94tXbnVFiDGgSX/MHKIHEgOfGn/34+p/jVN+bX3ZRArUdGWON6KN93FPZSSnAXRqosx7wKGyir5TTGVIGiT1g2ycu/ZlVzLEqq6DUgGW4QFxNK/asEF7yMcDhRBpqJp0MlM7zbLT3oOR5RICbtheekDKI+Vm0smiHCDRMUnvjng7rC0/qZlnnYe9IkBswl+zwn0pmWLEC3Y2VeMPYM+PmKRQwZR84jnPXXH26QuK3NIvvkvi30YJx/v8wK6HwOeq9U6nMTPvQ6X/94jg/7qYNSdbzMLx1cLaSelbKKSQ4tiiDfURMvDimHIlD4ukYo/POjtP/1ocCymejKpsRy3rZgFdrUmA2KQU+pjj4SVF6jXvvzD6ZxXtc/PA8MvsGRslkG4ooGZCIvyTxLRQkUXxwdzBqRwd3FpkGUmO+wI3L9Cpq/kZnAMNvq6TOKKkGlAdsYIQd0szjxGZWRETDa8Lz1+jE+Q3mjyYLiRewnOIPKUYf0a/WIK/SnS4BmBAqBidvyL+fP2xirSUVZg3Y4PKBsZ14/OZG9FQXxq/9aJrOy5yBPEcfBY1oET4hycAN4jGaeW4T7JxqBq1j/CeUNsV6JjIfUIiIOYAxui9GX3alVJQkA1cRAbkPnYJZ1cf5tIAzmryObVTE/H5AzKq+0RETEInv4i9nzsA4G3Twj/AHbmj08t/APPEDAcbYDSrEhGYc5/sg2EcAz8KV5fF7VMhvu5soIvGe5TsAAAAASUVORK5CYII=",
                                    "horizontalAlignment": "Center",
                                    "width": "12px",
                                    "height": "12px"
                                }
                            ],
                            "verticalContentAlignment": "Center",
                            "spacing": "Large"
                        },
                        {
                            "type": "Column",
                            "width": "auto",
                            "items": [
                                {
                                    "type": "TextBlock",
                                    "size": "Small",
                                    "isSubtle": true,
                                    "text": "Mic is off",
                                    "spacing": "None"
                                }
                            ],
                            "verticalContentAlignment": "Center",
                            "spacing": "Small"
                        }
                    ],
                    "spacing": "None"
                },
                {
                    "type": "Container",
                    "items": [
                        {
                            "type": "TextBlock",
                            "size": "Small",
                            "color": "Accent",
                            "text": "Change meeting settings"
                        }
                    ],
                    "selectAction": {
                        "type": "Action.Submit",
                        "data": {
                            "intent:confirm": true,
                            "change_settings": "true"
                        },
                        "title": "Change meeting settings"
                    }
                }
            ],
            "spacing": "ExtraLarge"
        },
        {
            "type": "Container",
            "spacing": "Medium"
        }
    ],
    "actions": [
        {
            "type": "Action.Submit",
            "data": {
                "intent:confirm": true
            },
            "title": "Join"
        },
        {
            "type": "Action.Submit",
            "data": {
                "intent:cancel": true
            },
            "title": "Cancel"
        }
    ]
}

Sample Code Language

objective c

Sample Code

Announce twice issue

- (NSString *)gatherAccessibilityLabelsFromSubviews
{
    return nil;
    NSMutableArray<NSString *> *mergedA11yLabels = [[NSMutableArray alloc] init];
    // include a11y labels of current view
    if (super.accessibilityLabel && super.accessibilityLabel.length) {
        [mergedA11yLabels addObject:super.accessibilityLabel];
    }

    for (UIView *subview in [self getArrangedSubviews]) {
        if (!subview.isHidden) {
            // if the subview is a collection type
            if ([subview isKindOfClass:[ACRContentStackView class]]) {
                [mergedA11yLabels addObject:[(ACRContentStackView *)subview gatherAccessibilityLabelsFromSubviews]];
            } else if (subview.accessibilityLabel) {
                [mergedA11yLabels addObject:subview.accessibilityLabel];
            }
        }
    }

    return [mergedA11yLabels componentsJoinedByString:@","];
}

in source/ios/AdaptiveCards/AdaptiveCards/AdaptiveCards/ACRContentStackView.mm

kaichun-wu avatar Nov 23 '22 03:11 kaichun-wu

@kaichun-wu, 2.8.8 iOS renderer doesn't have this issue; hopefully this issue will be resolved in Teams' app since Team is integrating 2.8.8. announcing twice is not ios renderer issue. it's because selection action has same text twice, and the texts are used in making a11y labels.

{
                    "type": "Container",
                    "items": [
                        {
                            "type": "TextBlock",
                            "size": "Small",
                            "color": "Accent",
                            "text": "Change meeting settings"
                        }
                    ],
                    "selectAction": {
                        "type": "Action.Submit",
                        "data": {
                            "intent:confirm": true,
                            "change_settings": "true"
                        },
                        "title": "Change meeting settings"
                    }
                }

title of selectAction and text of TextBlock are used in a11y labels generation; please change either of the two for the desired experience.

jwoo-msft avatar Dec 05 '22 21:12 jwoo-msft