@@ -3,17 +3,16 @@ import { TabStripItem as TabStripItemDefinition } from ".";
33import { PropertyChangeData } from "../../../data/observable" ;
44import { TabNavigationBase } from "../tab-navigation-base" ;
55import { TabStrip } from "../tab-strip" ;
6- import { Image } from "../../image/image" ;
7- import { Label } from "../../label/label" ;
86import { Color } from "../../../color" ;
97import { AddChildFromBuilder } from "../../core/view" ;
108
119// Requires
1210import {
1311 View , ViewBase , CSSType , backgroundColorProperty , backgroundInternalProperty , PseudoClassHandler
1412} from "../../core/view" ;
15- import { Tabs } from "../../tabs" ;
1613import { isIOS } from "../../../platform" ;
14+ import { Image } from "../../image/image" ;
15+ import { Label } from "../../label/label" ;
1716
1817export * from "../../core/view" ;
1918export const traceCategory = "TabView" ;
@@ -173,14 +172,14 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi
173172 }
174173
175174 public _addChildFromBuilder ( name : string , value : any ) : void {
176- if ( name === " Image" ) {
175+ if ( value instanceof Image ) {
177176 this . image = < Image > value ;
178177 this . iconSource = ( < Image > value ) . src ;
179178 this . _addView ( value ) ;
180179 // selectedIndexProperty.coerce(this);
181180 }
182181
183- if ( name === " Label" ) {
182+ if ( value instanceof Label ) {
184183 this . label = < Label > value ;
185184 this . title = ( < Label > value ) . text ;
186185 this . _addView ( value ) ;
@@ -213,7 +212,9 @@ export class TabStripItem extends View implements TabStripItemDefinition, AddChi
213212 const parent = < TabStrip > this . parent ;
214213 const tabStripParent = parent && < TabNavigationBase > parent . parent ;
215214 if ( this . _index === tabStripParent . selectedIndex &&
216- ! ( isIOS && tabStripParent instanceof Tabs ) ) {
215+ ! ( isIOS && tabStripParent . cssType . toLowerCase ( ) === "tabs" ) ) {
216+ // HACK: tabStripParent instanceof Tabs creates a circular dependency
217+ // HACK: tabStripParent.cssType === "Tabs" is a hacky workaround
217218 this . _goToVisualState ( "highlighted" ) ;
218219 }
219220 } else {
0 commit comments