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

Show validation error rect on Toggle and ChoiceSet #4472

Merged
merged 2 commits into from
Jul 23, 2020

Conversation

dclaux
Copy link
Member

@dclaux dclaux commented Jul 22, 2020

Related Issue

Fixes #4362

Description

A red rectangle is now displayed around Input.Toggle and Input.ChoiceSet (in multiselect and expanded modes) when failing validation.

How Verified

Verified manually in adaptivecards-designer-app

Test card:

{
    "type": "AdaptiveCard",
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.3",
    "body": [
        {
            "type": "Input.Toggle",
            "title": "New Input.Toggle",
            "id": "a",
            "isRequired": true,
            "errorMessage": "Invalid",
            "label": "Toggle input"
        },
        {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "Choice 1",
                    "value": "Choice 1"
                },
                {
                    "title": "Choice 2",
                    "value": "Choice 2"
                }
            ],
            "placeholder": "Placeholder text",
            "isMultiSelect": true,
            "id": "b",
            "label": "Input.ChoiceSet w/multiselect",
            "isRequired": true,
            "errorMessage": "Invalid"
        },
        {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "Choice 1",
                    "value": "Choice 1"
                },
                {
                    "title": "Choice 2",
                    "value": "Choice 2"
                }
            ],
            "placeholder": "Placeholder text",
            "style": "expanded",
            "label": "Input.ChoiceSet w/expanded style",
            "isRequired": true,
            "errorMessage": "Invalid",
            "id": "c"
        }
    ],
    "actions": [
        {
            "type": "Action.Submit",
            "title": "Action.Submit"
        }
    ]
}
Microsoft Reviewers: Open in CodeFlow

@dclaux dclaux requested a review from almedina-ms July 22, 2020 22:22
@ghost
Copy link

ghost commented Jul 22, 2020

Hi @dclaux. Thanks for helping make the AdaptiveCards JS renderer + tooling better. As additional verification, once the JS build succeeds, please go to the test site to test out your website/designer changes.

Copy link
Member

@shalinijoshi19 shalinijoshi19 left a comment

Choose a reason for hiding this comment

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

:shipit:

@shalinijoshi19
Copy link
Member

Cool; Verified with the card in the issue to confirm the rectangle as well as the additional warnigs around Labels + RequiredInputs missing

@dclaux dclaux merged commit c59079a into main Jul 23, 2020
@dclaux dclaux deleted the ts/toggleinput-validation branch July 23, 2020 01:22
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.

[JavaScript] [Input Validation] isRequired doesn't trigger red styling for Input.Toggle
2 participants