question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adaptive Card 1.2 style "positive" and "destructive" is not working

See original GitHub issue

Description

Styling an action in Adaptive Card using “positive” and “destructive”.

You can copy the JSON below, save it to a file, then upload it to MockBot. MockBot will render it as an Adaptive Card.

{
    "type": "AdaptiveCard",
    "body": [
        {
            "type": "TextBlock",
            "text": "Hello, World!"
        }
    ],
    "actions": [
        {
            "type": "Action.Submit",
            "title": "Submit",
            "style": "destructive"
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.0"
}

Screenshots

Screenshot from Adaptive Card Designer

image

Screenshot from Web Chat Playground

image

Screenshot of the DOM tree

image

As you can see here, there is a class named style-destructive. I believe this will turn the button red. But looks like we did not load the CSS required for this style.

Version

I am using “master” branch of Web Chat. Verified it is using AC 1.2 package.

To Reproduce

Steps to reproduce the behavior:

  1. Save the JSON above and name it destructive.json
  2. Navigate to https://webchat-playground.azurewebsites.net/
  3. Uplaod the JSON file to MockBot

Expected behavior

MockBot should reply with an Adaptive Card with the button marked as red. Similar to the screenshot from Adaptive Card Designer.

Additional context

It could be Adaptive Card 1.2 has a new CSS and we did not load the CSS. This is because there is a class “style-destructive” but it was not styled by any CSS rules.

Feature list on Adaptive Card 1.2 include “action sentiment”, see it at https://github.com/microsoft/AdaptiveCards/issues/2444.

[Bug]

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
DesignPolicecommented, Jul 9, 2019

@compulim we selected a hover color for the blue, (you are correct the red is very strong), but I will address all of the colors and buttons in the Fluent update to WebChat. I’m waiting on some accessibility changes from the Fabric team, it failed on many levels. They should update in a few weeks. So one set of changes instead of lots of little ones. I will keep you posted on that status.

2reactions
corinagumcommented, Jul 9, 2019

@tdurnford already had a convo with @DesignPolice afaik

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adaptive card in MS teams: Can I add action with primary ...
According to Adaptive card doc, they support Action sentiment (primary/destruction) in v1. 2. According to offer 365 blog, Adaptive cards 1.2 ...
Read more >
Action.Submit - Schema Explorer | Adaptive Cards
"positive" : Action is displayed with a positive style (typically the button becomes accent color); "destructive" : Action is displayed with a destructive...
Read more >
Action.ShowCard - Schema Explorer - Adaptive Cards
"positive" : Action is displayed with a positive style (typically the button becomes accent color); "destructive" : Action is displayed with a destructive...
Read more >
Action.ToggleVisibility - Schema Explorer | Adaptive Cards
Controls the style of an Action, which influences how the action is displayed, spoken, etc. 1.2. fallback, Action , FallbackOption, No, Describes what...
Read more >
Action.OpenUrl - Schema Explorer | Adaptive Cards
style, ActionStyle, No, Controls the style of an Action, which influences ... a positive style (typically the button becomes accent color); "destructive" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found