Adaptive Card Containser's Style is not Respected
See original GitHub issueScreenshots
Version
CDN v4.7.1
Describe the bug
Adding style to the container does not have any effect. For example “style”: “good” is entered in the bellow code but webchat does not set the container background to light green or any color.
Steps to reproduce
- Use the provided adaptive card below.
- Observe that in webchat the containers’ background color is not set.
Expected behavior
Should set the containers’ background color to “good” light green.
Additional context
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.1",
"body": [
{
"type": "Container",
"style": "good",
"bleed": true,
"items": [
{
"type": "TextBlock",
"text": "Publish Adaptive Card schema",
"weight": "bolder",
"size": "medium"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"url": "https://pbs.twimg.com/profile_images/3647943215/d7f12830b3c17a5a9e4afcc370e3a37e_400x400.jpeg",
"size": "small",
"style": "person"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Matt Hidinger",
"weight": "bolder",
"wrap": true
},
{
"type": "TextBlock",
"spacing": "none",
"text": "Created {{DATE(2017-02-14T06:08:39Z,SHORT)}}",
"isSubtle": true,
"wrap": true
}
]
}
]
}
]
},
{
"type": "Container",
"style": "good",
"bleed": true,
"items": [
{
"type": "TextBlock",
"text": "Now that we have defined the main rules and features of the format, we need to produce a schema and publish it to GitHub. The schema will be the starting point of our reference documentation.",
"wrap": true
},
{
"type": "FactSet",
"facts": [
{
"title": "Board:",
"value": "Adaptive Card"
},
{
"title": "List:",
"value": "Backlog"
},
{
"title": "Assigned to:",
"value": "Matt Hidinger"
},
{
"title": "Due date:",
"value": "Not set"
}
]
}
]
}
],
"actions": [
{
"type": "Action.ShowCard",
"title": "Set due date",
"card": {
"type": "AdaptiveCard",
"body": [
{
"type": "Input.Date",
"id": "dueDate",
"title": "Select due date"
},
{
"type": "Input.Text",
"id": "comment",
"isMultiline": true,
"placeholder": "Add a comment"
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "OK",
"url": "https://adaptivecards.io"
}
]
}
},
{
"type": "Action.OpenUrl",
"title": "View",
"url": "https://adaptivecards.io"
}
]
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
More bugs with Teams adaptive card containers not
More bugs with Teams adaptive card containers not respecting the container style? Hi all, I have several flows which generate adaptive cards ......
Read more >Container bleed - Schema Explorer | Adaptive Cards
If no parent container has verticalContentAlignment set, it defaults to Top. ... style. Style hint for Container . Type: ContainerStyle? Required: No ......
Read more >Image - Schema Explorer | Adaptive Cards
Applies a background to a transparent image. This property will respect the image style. Type: string; Version : 1.1; Required: No. JSON
Read more >Input.Text - Schema Explorer | Adaptive Cards
Displayed when no text has been input. 1.0. regex, string, No, Regular expression indicating the required format of this text input. 1.3. style...
Read more >Column - Schema Explorer | Adaptive Cards
style, ContainerStyle? No, Style hint for Column . ... If no parent container has verticalContentAlignment set, it defaults to Top.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After looking into this further, this issue is actually unrelated to #2145.
Our default Adaptive Card HostConfig is missing Container Styles. Adding the
containerStyles
to ouradaptiveCardHostConfig
resolves this issue. @arman-g In the meantime, you can pass your ownadaptiveCardHostConfig
as a prop to Web Chat as exemplified in the code snippet below.Web Chat v4.7.1
Screenshot
@Tiger519 ‘How to’ questions such as this one are better suited for Stack Overflow. Please feel free to post other questions you have about developing your own features over there so the community at large may help out. If you need help with a Web Chat implementation, you can post a question to the Web Chat tag. Thank you!