【发布时间】:2014-12-13 01:09:44
【问题描述】:
在选项卡中放置开关( md-switch 指令)时,会引发 aria 错误
ARIA:可访问性所需的属性“aria-label”在节点上缺失:...
无论是否存在 aria 标签,都会发生这种情况。如果将开关移到选项卡之外,它会按预期工作。
plunker 显示问题 http://plnkr.co/edit/FmZAyLBpzhURbdZuuhQK?p=preview
<div ng-app="app" ng-controller="ctrl" >
<md-tabs md-selected="selectedIndex">
<md-tab id="tab1">Item One</md-tab>
</md-tabs>
<ng-switch on="selectedIndex" class="tabpanel-container">
<div role="tabpanel" id="tab1-content" ng-switch-when="0">
<div>
<md-switch aria-label="toggle" ng-model="data.switch">Switch : {{ toggle }}</md-switch>
</div>
</div>
</ng-switch>
</div>
<script>
var app = angular.module('app', ['ngMaterial']);
app.controller("ctrl", function ($scope) {
$scope.toggle = false;
$scope.selectedIndex = 0;
});
</script>
【问题讨论】: