Skip to content

[Bug] - Error when setting a font on TabView on iOS #654

@bsnelder

Description

@bsnelder

Issue:
After upgrading to {N} 2.5 and then setting a custom font (family or size) using CSS on a TabView I get the following error in the console using the iOS simulator:

CONSOLE ERROR file:///app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:344:22: Error: Uncaught (in promise): TypeError: null is not an object (evaluating 'tabBar.items.count')

It seems to be working when setting the font-family directly on the TabView (just shows the error in the console). However when I set the custom font on the Page instead of directly on the TabView the whole TabView is blank.

This only applies to iOS. Works fine on the Android emulator.

Example:
Tried this with {N} 2.5 on the default ng template using tns create component-core --ng and then modifying the default items.component.html with the following template.

items.component.html

<ActionBar title="TestTitle" style.backgroundColor="#149718"></ActionBar>

<TabView sdkExampleTitle sdkToggleNavButton>
    <StackLayout *tabItem="{title: 'Overview'}" >
        <Label text="Test Label"></Label>
    </StackLayout>
</TabView>

app.css

TabView {
    background-color: #F3F3F3;
    font-family: 'Courier'; // Enabling this (without the font-family defined on the Page) results in just the console error
}


Page { 
    font-family: 'Courier'; // Enabling this results in the error and shows a blank TabView 
}

Versions:
Nativescript version: 2.5
Nativescript-angular version: 1.4.0 (also tried the next version: 1.4.1-2017-01-31-1230)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions