microsoft / botbuilder-js

Welcome to the Bot Framework SDK for JavaScript repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using JavaScript.
https://github.com/Microsoft/botframework
MIT License
660 stars 275 forks source link

`Input.Text` not displaying when used with `isRequired: true` #4653

Closed petru-guider closed 1 month ago

petru-guider commented 1 month ago

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

Microsoft-BotFramework/3.1 botframework-connector/4.22.1 core-http/3.0.4 Node/v18.19.0 OS/(arm64-Darwin-23.4.0)

Describe the bug

Adaptive Card Input.Text not displaying when used with isRequired: true.

To Reproduce

Steps to reproduce the behavior:

  1. Make a GET request to /api/notify endpoint with a route handler sends a proactive message using following card
    await context.sendActivity({
    attachments: [
    CardFactory.adaptiveCard({
      body: [
        {
          type: 'TextBlock',
          text: 'Text area',
        },
        {
          type: 'Input.Text',
          id: 'id',
          placeholder: 'Placeholder text',
          maxLength: 500,
          isMultiline: true,
        },
      ],
      actions: [
        {
          type: 'Action.Submit',
          title: 'Submit',
        },
      ],
    }),
    ],
    });
  2. Check bot framework
  3. Card is displayed properly image
  4. Add isRequired after isMultiline
  5. Make another GET request to /api/notify
  6. Card is not displayed properly image

Expected behavior

Input.Text works properly with isRequired: true.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

I'm also using Input.ChoiceSet and it works fine with isRequired: true.

Tracking Status

Dotnet SDK [TODO]()

Javascript SDK [TODO]()

Python SDK [TODO]()

Java SDK [TODO]()

Samples [TODO]()

Docs [TODO]()

Tools [TODO]()

stevkan commented 1 month ago

@petru-guider - Thank you for your patience. It seems that when using the isRequired property, it is necessary to include the label and errorMessage properties, as well. I did a cursory search and didn't see this stated anywhere obvious in their docs. I only discovered the requirement when looking at the dev console for the browser where a couple warnings where displayed. Curiously, the Adaptive Cards Designer didn't produce any errors or warnings when I ran the card there. Anyhow, once I included the additional fields, the card rendered without issue.

Closing a resolved.