Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
anna-dingler merged 2 commits into
mainfrom
anna/updateCheckboxLabel
May 15, 2024
Merged

[JS renderer] Only add additional labels to the first checkbox in a multi select input#8912
anna-dingler merged 2 commits into
mainfrom
anna/updateCheckboxLabel

Conversation

@anna-dingler

Copy link
Copy Markdown
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).

@paulcam206 paulcam206 left a comment

Copy link
Copy Markdown
Member

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

anna-dingler commented May 15, 2024

Copy link
Copy Markdown
Contributor Author

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

Development

Successfully merging this pull request may close these issues.

{Linked:Bug11845587}[Adaptive Cards > Designer] - NVDA is announcing grouping label name for all the check boxes.

2 participants