Microsoft Lists更新后?env=WebViewList视图JSON列格式化链接失效
Microsoft Lists WebViewList视图下自定义JSON列格式化超链接点击无响应
问题概述
此前我们通过JSON列格式化在「单行文本」类型列中实现超链接功能。在Microsoft Lists完成近期更新后,自定义JSON生成的超链接仅在列表URL带有?env=WebViewList后缀的现代视图中出现点击无响应的问题,官方示例代码则不受影响。移除该URL后缀后链接功能恢复正常,且租户内所有站点列表均存在此问题。
复现步骤
- 创建Microsoft List;
- 进入列表并确认URL带有
?env=WebViewList后缀(个人及SharePoint站点内列表均可复现); - 创建「单行文本」类型列;
- 点击列标题,选择「列设置」>「格式化此列」>「高级模式」;
- 粘贴以下JSON代码并保存:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "a", "attributes": { "href": "https://www.google.com", "target": "_blank" }, "style": { "text-decoration": "none" }, "children": [ { "elmType": "button", "attributes": { "class": "ms-fontColor-themePrimary ms-fontColor-themeDark--hover", "title": "Click Me" }, "style": { "border": "none", "background-color": "transparent", "cursor": "pointer" }, "children": [ { "elmType": "span", "attributes": { "iconName": "Attach", "class": "ms-font" }, "style": { "padding-right": "2px" } }, { "elmType": "span", "txtContent": "Click Me" } ] } ] }
- 添加列表项查看生成的链接;
- 点击生成的链接无反应;
- 若为SharePoint站点内列表,移除URL中的
?env=WebViewList后缀并刷新,链接恢复正常。
补充测试发现
进一步测试显示,点击链接文本右侧的空白区域时链接可正常触发,但点击文本本身无响应。
内容的提问来源于stack exchange,提问作者user1063287
相关产品推荐
相关产品推荐

