当我经常切换md-tabs时,Md-tabs正确切换,但是多个md-tab-item元素同时具有'md-active'类,所以我看不到标签的内容是活动的,因为它是重叠的通过其右侧标签的内容.
根据我的说法,在角度材质中,当我们选择一个选项卡时,角度首先取消选择上一个选项卡(隐藏页面上先前显示的内容)并显示选定的选项卡内容.在执行此过程时,角度未命中删除先前活动的选项卡的"md-active"类.
这是重现行为的小提琴.这是随机行为,同时发生并发点击.
点击"切换标签"按钮jsFiddle后,请等待1分钟
angular.module('firstApplication', ['ngMaterial']).controller('tabController', tabController);
function tabController ($scope) {
$scope.boards = Array.from(Array(100).keys());
$scope.data = {
selectedIndex: 0,
secondLocked: true,
secondLabel: "2",
bottom: false
};
$scope.next = function() {
$scope.data.selectedIndex = Math.min($scope.data.selectedIndex + 1, 2) ;
};
$scope.previous = function() {
$scope.data.selectedIndex = Math.max($scope.data.selectedIndex - 1, 0);
};
$scope.switch = function() {
$scope.activeTabsCounter = $("md-tab-item.md-active").length;
}
/********* Here i am changing tabs ****8**/
/******** This is strict behaviour where I get the problem but randomly *****/
$scope.switchTabs …Run Code Online (Sandbox Code Playgroud)