nativescript-angular icon indicating copy to clipboard operation
nativescript-angular copied to clipboard

Rendering issue when using *ngFor inside a TabView, NS 4.0

Open gummibjorn opened this issue 8 years ago • 7 comments

Platform iOS

Description Given a template that uses *ngFor inside a tab content: The first rendering works fine, but if the underlying datasource is replaced rendering the items of the new source doesn't seem to happen.

Steps to reproduce

  1. Download the playground app linked below
  2. tns run ios
  3. click the refresh button and the list is empty

Worked fine in NS 3.4

https://play.nativescript.org/?template=play-ng&id=u8JfoL&v=2

gummibjorn avatar Apr 19 '18 13:04 gummibjorn

Are there any (even temporary) solutions for this bug?

I've noticed that a similar behavior happen using *ngIf or using bindings like (click)="someMethod()" (where the method is not called when event is triggered). This happen always inside a tab content.

Thanks

andr35 avatar May 15 '18 14:05 andr35

@Andr35 downgrading to 3.4 is my temporary solution for now

I can image that *ngIf could be affected by the same failure.

I guess by (click)="someMethod" you meant (tap)="someMethod"? I can't confirm this particular problem

gummibjorn avatar May 15 '18 14:05 gummibjorn

@gummibjorn Yes, I wanted to write (tap). I've got confused.

andr35 avatar May 15 '18 17:05 andr35

The issue is still reproducible with @next nativescript-angular.

tsonevn avatar May 16 '18 13:05 tsonevn

I had this issue too, I delete node_modules and platform folders, run on ios again using this pacakge.json. At this moment is works fine.

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "hello",
    "tns-android": {
      "version": "4.0.1"
    },
    "tns-ios": {
      "version": "4.0.1"
    }
  },
  "dependencies": {
    "@angular/animations": "~5.2.0",
    "@angular/common": "~5.2.0",
    "@angular/compiler": "~5.2.0",
    "@angular/core": "~5.2.0",
    "@angular/forms": "~5.2.0",
    "@angular/http": "~5.2.0",
    "@angular/platform-browser": "~5.2.0",
    "@angular/platform-browser-dynamic": "~5.2.0",
    "@angular/router": "~5.2.0",
    "nativescript-angular": "~5.3.0",
    "nativescript-floatingactionbutton": "^4.1.3",
    "nativescript-plugin-firebase": "^5.3.1",
    "nativescript-theme-core": "~1.0.4",
    "reflect-metadata": "~0.1.8",
    "rxjs": "~5.5.2",
    "tns-core-modules": "~4.0.0",
    "zone.js": "~0.8.2"
  },
  "devDependencies": {
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "~0.7.0",
    "typescript": "~2.7.2"
  }
}

lucassampsouza avatar May 23 '18 04:05 lucassampsouza

I updated tns-core-modules to version 4.0.1 and the issue disappeared. Now my app works fine.

andr35 avatar May 23 '18 14:05 andr35

I can confirm that the issue is fixed in [email protected]

thx everyone

gummibjorn avatar May 23 '18 14:05 gummibjorn