Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 312dcc6

Browse files
author
Robert Messerle
committed
fix(tabs): adds fix for css transition on theme change
Closes #1033.
1 parent 572da37 commit 312dcc6

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/components/tabs/js/tabItemDirective.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ function MdTabDirective($mdInkRipple, $compile, $mdUtil, $mdConstant, $timeout)
9191
var tabItemCtrl = ctrls[0]; // Controller for THIS tabItemCtrl
9292
var tabsCtrl = ctrls[1]; // Controller for ALL tabs
9393

94+
$timeout(element.addClass.bind(element, 'md-tab-themed'), 0, false);
95+
9496
scope.$watch(
9597
function () { return attr.label; },
9698
function () { $timeout(function () { tabsCtrl.scope.$broadcast('$mdTabsChanged'); }, 0, false); }

src/components/tabs/tabs.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,11 @@ md-tab {
153153
cursor: pointer;
154154
padding: 20px 24px;
155155
box-sizing: border-box;
156-
transition: background 0.35s $swift-ease-in-out-timing-function,
157-
color 0.35s $swift-ease-in-out-timing-function;
156+
transition: none;
157+
&.md-tab-themed {
158+
transition: background 0.35s $swift-ease-in-out-timing-function,
159+
color 0.35s $swift-ease-in-out-timing-function;
160+
}
158161

159162
&[disabled] {
160163
pointer-events: none;

0 commit comments

Comments
 (0)