简体   繁体   English

Action.ShowCard 卡内的 Input.ChoiceSet 不起作用 #361

[英]Input.ChoiceSet inside Action.ShowCard card not working #361

We are using https://www.npmjs.com/package/botbuilder to build a bot for Microsoft Teams.我们正在使用https://www.npmjs.com/package/botbuilder为 Microsoft Teams 构建机器人。 We have the following payload to create a card, which has an Input.ChoiceSet inside an Action.ShowCard card.我们有以下有效负载来创建一张卡片,它在 Action.ShowCard 卡片中有一个 Input.ChoiceSet。 It works fine when I preview the card from the bar but it doesn't work after I send the card.当我从栏中预览卡片时它工作正常,但在我发送卡片后它不起作用。 Sometimes if I restart the MST client it works when I click on a card for the first time but then it doesn't work after that.有时,如果我重新启动 MST 客户端,当我第一次单击卡时它会工作,但之后它就不起作用了。 Sometimes it never works, only from the preview.有时它永远不会起作用,只能从预览中获得。

It does work fine on Android but it doesn't work on Linux, Mac or web clients.它在 Android 上运行良好,但在 Linux、Mac 或 web 客户端上运行良好。

Here is a demo of the issue, https://www.loom.com/share/7cfec55b587941899cd66e1d896df065这是该问题的演示, https://www.loom.com/share/7cfec55b587941899cd66e1d896df065

And here is the payload.这是有效载荷。 Try the Click me, button.试试点击我,按钮。 which should display a dropdown.这应该显示一个下拉列表。

{
    "type":"message",
    "attachments":[
        {
            "contentType":"application/vnd.microsoft.card.adaptive",
            "content":{
                "$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
                "type":"AdaptiveCard",
                "version":"1.2",
                "actions":[
                    {
                        "type":"Action.OpenUrl",
                        "title":"Action 1",
                        "url":"https://my.website.com"
                    },
                    {
                        "type":"Action.Submit",
                        "title":"Action 2",
                        "data":{
                            "command":"action 1",
                            "data":"asdasd"
                        }
                    },
                    {
                        "type":"Action.ShowCard",
                        "title":"Click me!",
                        "card":{
                            "type":"AdaptiveCard",
                            "version":"1.0",
                            "body":[
                                {
                                    "type":"Input.ChoiceSet",
                                    "id":"SelectUser",
                                    "style":"compact",
                                    "value":"1",
                                    "choices":[
                                        {
                                            "title":"User 1",
                                            "value":"1"
                                        },
                                        {
                                            "title":"User 2",
                                            "value":"2"
                                        },
                                        {
                                            "title":"User 3",
                                            "value":"3"
                                        }
                                    ],
                                    "height":"stretch",
                                    "wrap":true,
                                    "isMultiSelect":false
                                }
                            ],
                            "actions":[
                                {
                                    "type":"Action.Submit",
                                    "title":"Action 3.1",
                                    "data":{
                                        "command":"action 3.1",
                                        "data":"asdasd"
                                    }
                                }
                            ]
                        }
                    },
                    {
                        "type":"Action.ShowCard",
                        "title":"Action 4",
                        "card":{
                            "type":"AdaptiveCard",
                            "body":[
                                {
                                    "type":"Input.Text",
                                    "label":"Enter comment",
                                    "style":"text",
                                    "id":"text",
                                    "isMultiline":true,
                                    "placeholder":"Enter your comment"
                                }
                            ],
                            "actions":[
                                {
                                    "type":"Action.Submit",
                                    "title":"Save",
                                    "data":{
                                        "command":"save",
                                        "data":"asdasd"
                                    }
                                }
                            ]
                        }
                    }
                ],
                "body":[
                    {
                        "type":"TextBlock",
                        "size":"medium",
                        "weight":"bolder",
                        "text":"text... text... text",
                        "wrap":true
                    },
                    {
                        "type":"ColumnSet",
                        "columns":[
                            {
                                "type":"Column",
                                "width":"auto",
                                "items":[
                                    {
                                        "type":"Image",
                                        "style":"Person",
                                        "url":"https://avatar.com/avatar.png",
                                        "size":"small"
                                    }
                                ]
                            },
                            {
                                "type":"Column",
                                "width":"stretch",
                                "items":[
                                    {
                                        "type":"TextBlock",
                                        "weight":"lighter",
                                        "text":"text... text... text",
                                        "wrap":true
                                    },
                                    {
                                        "type":"TextBlock",
                                        "spacing":"None",
                                        "text":"text... text... text",
                                        "isSubtle":true,
                                        "wrap":true
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "type":"Container",
                        "items":[
                            {
                                "columns":[
                                    {
                                        "spacing":"small",
                                        "width":"auto",
                                        "verticalContentAlignment":"Center",
                                        "type":"Column",
                                        "selectAction":{
                                            "targetElements":[
                                                "fields-content",
                                                "showFields",
                                                "hideFields"
                                            ],
                                            "type":"Action.ToggleVisibility",
                                            "title":"expand"
                                        },
                                        "items":[
                                            {
                                                "type":"TextBlock",
                                                "id":"showFields",
                                                "horizontalAlignment":"Left",
                                                "color":"Accent",
                                                "text":"Show fields",
                                                "wrap":true
                                            },
                                            {
                                                "type":"TextBlock",
                                                "id":"hideFields",
                                                "horizontalAlignment":"Left",
                                                "color":"Accent",
                                                "text":"Hide fields",
                                                "wrap":true,
                                                "isVisible":false
                                            }
                                        ]
                                    }
                                ],
                                "type":"ColumnSet"
                            },
                            {
                                "id":"fields-content",
                                "isVisible":false,
                                "type":"Container",
                                "items":[
                                    {
                                        "type":"FactSet",
                                        "facts":[
                                            {
                                                "title":"title",
                                                "value":"value"
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    ]
}

Currently we don't have the sample code in nodejs.Agree with you problem in using node library.目前我们在 nodejs 中没有示例代码。同意您使用节点库的问题。 I too tested with your payload.我也用你的有效载荷进行了测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM