botframework - 在 Microsoft BotFramework 的自适应卡片中定义 Tab 键顺序
问题描述
tl;dr:我们如何定义自适应卡片输入元素的 Tab 键顺序?
你好呀,
我们在网络聊天项目中使用自适应卡片以及 MS Bot Framework V4。例如,我们有一张卡,您可以在其中输入您的地址。我们有两列以 2x2 的方式并排显示输入字段:
街道 | 数字
邮编 | 城市
这就是我们的客户通常会读到的方式——从左到右,一排的东西是在一起的。但是当我们使用列时,自适应卡的选项卡顺序是“错误的”:它在列中进行选项卡,然后转到右列,并从上到下从那里通过选项卡。
有没有办法定义标签顺序或者有人知道如何保持自适应卡的“布局”但最终得到正确的标签顺序?
此致
解决方案
解决方案比我想象的要容易得多:我必须将列集的每一行分成几个列集,每个列集都在自己的容器中。然后标签顺序从左到右然后从上到下正确。
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.2",
"body": [
{
"type": "TextBlock",
"text": "**Address**",
"size": "Large",
"height": "stretch"
},
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "street*",
"spacing": "Large",
"height": "stretch",
"weight": "Bolder"
},
{
"type": "Input.Text",
"placeholder": "Street",
"id": "street",
"value": "{street}"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Number*",
"spacing": "Large",
"weight": "Bolder"
},
{
"type": "Input.Text",
"placeholder": "Number",
"id": "number",
"value": "{number}"
}
]
}
]
}
]
},
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "Zip*",
"spacing": "Medium",
"weight": "Bolder"
},
{
"type": "Input.Text",
"placeholder": "Zip",
"id": "zip",
"value": "{zip}"
}
],
"spacing": "None",
"height": "stretch",
"horizontalAlignment": "Center"
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "City*",
"spacing": "Medium",
"weight": "Bolder"
},
{
"type": "Input.Text",
"placeholder": "City",
"id": "city",
"value": "{city}"
}
],
"horizontalAlignment": "Center",
"height": "stretch"
}
]
}
]
}
],
"actions": [
{
"type": "Action.Submit",
"title": "Send"
}
]
}
推荐阅读
- java - 将 PDF 转换为 Word 策略
- javascript - 多个元素的 JS/Jquery 按钮处理程序
- azure - 停止数据工厂中的集成运行时
- reactjs - React:react-router-dom 的 Redirect 不是重新加载页面,而是更改了 URL
- python - pip 正在为 python2.7 安装,但不是为 python3.7
- xaml - 更改 barcolor Flyout xamarin xaml
- python - 在一般反向传播中更新权重
- javascript - 如何为角度生产构建解决 JavaScript 堆内存不足问题?
- android - 即使设置了变量,也无法找到“ANDROID_HOME”环境变量 Cordova
- azure - Azure API Manager 增加了函数缩放时的响应时间