Nativescript: Change detection on tabview content is not working (iOS)

Created on 3 May 2018  路  4Comments  路  Source: NativeScript/NativeScript

Tell us about the problem

When we try to update the view inside the tabview content by first showing an ActivityIndicator and after some time changing it to a simple Label, the Label will not be shown on iOS

Which platform(s) does your issue occur on?

iOS

Please provide the following version numbers that your issue occurs with:

  • CLI: 4.0.0
  • Cross-platform modules: 4.0.0
  • Runtime(s): 4.0.1 for iOS and Android
  • Plugin(s): none

Please tell us how to recreate the issue in as much detail as possible.

https://play.nativescript.org/?template=play-ng&id=OowF7j
Just open the project and see the ActivityIndicator for five seconds, after which the Label should be displayed, but it is not.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

home.component.ts

export class HomeComponent implements OnInit {
    public isLoading: boolean = true;

    public ngOnInit(): void {
        setTimeout(() => {
            this.isLoading = false;
        }, 5000);
    }
}

home.component.html

<TabView>
    <StackLayout *tabItem="{ title: 'Tab1' }">
        <GridLayout>
            <ActivityIndicator *ngIf="isLoading" [busy]="true" horizontalAlignment="center" verticalAlignment="center">
            </ActivityIndicator>
            <Label *ngIf="!isLoading" text="First tab item"></Label>
        </GridLayout>
    </StackLayout>
    <StackLayout *tabItem="{ title: 'Tab2' }">
        <Label text="Second tab item"></Label>
    </StackLayout>
</TabView>
done

Most helpful comment

@MartoYankov I can confirm this is fixed in tns-core-modules@next. Thanks!!!

All 4 comments

@nickdekkers This seems to be the same problem as https://github.com/NativeScript/NativeScript/pull/5724 . It should be fixed in next. Can you switch to tns-core-modules@next and try it out?

@nickdekkers is this the Nick Deckers I know? Crazy coincidence if so. Did try out out @next? I'm having this same problem.

@MartoYankov I can confirm this is fixed in tns-core-modules@next. Thanks!!!

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings