Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS renderer] Only add additional labels to the first checkbox in a multi select input #8912

Merged
merged 2 commits into from
May 15, 2024

Conversation

anna-dingler
Copy link
Contributor

Related Issue

Fixes #8829

Description

For multi select inputs, the group label is announced for each individual checkbox. We only want to announce the group label (which includes errors) for the first checkbox shown. After that, only the label directly associated with the textbox should be read.

Sample Card

{
    "schema": "http=//adaptivecards.io/schemas/adaptive-card.json",
    "type": "AdaptiveCard",
    "version": "1.5",
    "body": [
        {
            "id": "",
            "isVisible": false,
            "separator": false,
            "spacing": "default",
            "type": "Container",
            "bleed": false,
            "items": [
                {
                    "id": "",
                    "isVisible": true,
                    "separator": false,
                    "spacing": "default",
                    "width": "32px",
                    "type": "Image",
                    "height": "32px",
                    "horizontalAlignment": "center",
                    "size": "auto",
                    "style": "default",
                    "url": "https://localhost:4321/node_modules/myhub-viva-library/dist/LoadingSpinner_231a701aee45eda2616de6679644dd24.gif",
                    "altText": "Loading indicator"
                },
                {
                    "id": "",
                    "isVisible": true,
                    "separator": false,
                    "spacing": "default",
                    "type": "TextBlock",
                    "style": "default",
                    "wrap": false,
                    "text": "Loading... Please wait.",
                    "horizontalAlignment": "center",
                    "size": "default"
                }
            ],
            "verticalContentAlignment": "center",
            "rtl": false,
            "sizes": {
                "imageSize": "32px",
                "fontSize": "default"
            }
        },
        {
            "id": "",
            "isVisible": true,
            "separator": false,
            "spacing": "default",
            "type": "Container",
            "bleed": false,
            "items": [
                {
                    "id": "",
                    "isVisible": true,
                    "separator": false,
                    "spacing": "default",
                    "type": "Container",
                    "bleed": false,
                    "items": [
                        {
                            "id": "",
                            "isVisible": true,
                            "separator": false,
                            "spacing": "none",
                            "width": "stretch",
                            "type": "Container",
                            "bleed": true,
                            "items": [],
                            "verticalContentAlignment": "center",
                            "rtl": false,
                            "backgroundImage": "https://localhost:4321/node_modules/myhub-viva-library/dist/HeaderLine_77d65ccd075fa6644bc29b64bd426343.png"
                        },
                        {
                            "id": "",
                            "isVisible": true,
                            "separator": false,
                            "spacing": "none",
                            "type": "ColumnSet",
                            "bleed": false,
                            "columns": [
                                {
                                    "type": "Column",
                                    "separator": false,
                                    "spacing": "none",
                                    "verticalContentAlignment": "center",
                                    "width": "stretch",
                                    "isVisible": true,
                                    "rtl": false,
                                    "items": [
                                        {
                                            "id": "",
                                            "isVisible": true,
                                            "separator": false,
                                            "spacing": "none",
                                            "type": "TextBlock",
                                            "style": "heading",
                                            "wrap": true,
                                            "text": "Add Causes"
                                        }
                                    ]
                                }
                            ]
                        }
                    ],
                    "verticalContentAlignment": "center",
                    "rtl": false,
                    "headerType": "basic"
                },
                {
                    "id": "",
                    "isVisible": true,
                    "separator": false,
                    "spacing": "default",
                    "type": "Container",
                    "bleed": false,
                    "items": [
                        {
                            "id": "impactViewRecordId",
                            "isVisible": true,
                            "separator": false,
                            "spacing": "Medium",
                            "width": "stretch",
                            "type": "Input.ChoiceSet",
                            "isRequired": false,
                            "isMultiSelect": true,
                            "style": "expanded",
                            "wrap": true,
                            "choices": [
                                {
                                    "title": "Absorption",
                                    "value": "ABS"
                                },
                                {
                                    "title": "Bodily Reaction",
                                    "value": "BR"
                                },
                                {
                                    "title": "Caught In, Under, or Between",
                                    "value": "CI"
                                },
                                {
                                    "title": "Driving Accident",
                                    "value": "DA"
                                },
                                {
                                    "title": "Exposure to, Contact with",
                                    "value": "ET"
                                },
                                {
                                    "title": "Ingestion",
                                    "value": "ING"
                                },
                                {
                                    "title": "Inhalation",
                                    "value": "INH"
                                },
                                {
                                    "title": "Overexertion / Ergonomic",
                                    "value": "OE"
                                },
                                {
                                    "title": "Rubbed or Abraded",
                                    "value": "ROA"
                                },
                                {
                                    "title": "Slip, Trip, Fall",
                                    "value": "STF"
                                },
                                {
                                    "title": "Struck Against / Struck By",
                                    "value": "SASB"
                                }
                            ],
                            "value": "",
                            "label": "Add Causes, If cause not listed, please provide more details in the previous page."
                        }
                    ],
                    "verticalContentAlignment": "center",
                    "rtl": false
                },
                {
                    "id": "",
                    "isVisible": true,
                    "separator": false,
                    "spacing": "large",
                    "type": "ActionSet",
                    "actions": [
                        {
                            "style": "positive",
                            "mode": "primary",
                            "isEnabled": true,
                            "id": "impactCausesSelectButtonId",
                            "title": "Select Cause(s)",
                            "tooltip": "Click here to select the causes and navigate to reporting step",
                            "type": "Action.Submit",
                            "associatedInputs": "auto",
                            "data": {
                                "id": "impactCausesSelectButtonId"
                            }
                        }
                    ]
                }
            ],
            "verticalContentAlignment": "center",
            "rtl": false
        }
    ],
    "actions": [],
    "refresh": null
}

How Verified

Verified manually on the AC site (local build).

Copy link
Member

@paulcam206 paulcam206 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable -- does the broken narration occur with Narrator?

@anna-dingler
Copy link
Contributor Author

anna-dingler commented May 15, 2024

seems reasonable -- does the broken narration occur with Narrator?

Yeah the old behavior occurred on both NVDA and Narrator. We had the parent label read for all associated check boxes which made a lot of noise. Now, we only add the parent label to the first check box

I verified the fix with Narrator

@anna-dingler anna-dingler enabled auto-merge (squash) May 15, 2024 22:50
@anna-dingler anna-dingler merged commit 31bbb89 into main May 15, 2024
7 checks passed
@anna-dingler anna-dingler deleted the anna/updateCheckboxLabel branch May 15, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants