Skip to content

TabView *tabItem binding not updating value #845

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
NickIliev opened this issue Jun 14, 2017 · 3 comments
Closed

TabView *tabItem binding not updating value #845

NickIliev opened this issue Jun 14, 2017 · 3 comments

Comments

@NickIliev
Copy link

NickIliev commented Jun 14, 2017

Test application to demonstrate the issue here

E.g.

<TabView #tv iosIconRenderingMode="alwaysTemplate" (selectedIndexChange)="onIndexChange($event)" selectedTabTextColor="green">
    <StackLayout *tabItem="myFirstItem">
        <Label text="First tap" textWrap="true"></Label>
    </StackLayout>
    <StackLayout *tabItem="mySecondItem">
        <Label text="Second tab item"></Label>
    </StackLayout>
    <StackLayout *tabItem="myThirdItem">
        <Label text="Third tab item"></Label>
    </StackLayout>
</TabView>

where myFirstItem is tabItem object of the follwing kind

this.myFirstItem = { title: "Selected", iconSource: "~/images/logo.png" };

Result: Changing the value via binding won't be respected

@NickIliev
Copy link
Author

Reproducible with with tns-core-modules 3.4.0

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "org.nativescript.tabViewSelectedIndex",
    "tns-android": {
      "version": "3.3.1"
    }
  },
  "dependencies": {
    "@angular/animations": "~5.0.0",
    "@angular/common": "~5.0.0",
    "@angular/compiler": "~5.0.0",
    "@angular/core": "~5.0.0",
    "@angular/forms": "~5.0.0",
    "@angular/http": "~5.0.0",
    "@angular/platform-browser": "~5.0.0",
    "@angular/platform-browser-dynamic": "~5.0.0",
    "@angular/router": "~5.0.0",
    "nativescript-angular": "^5.1.0-2017-12-19-01",
    "nativescript-theme-core": "~1.0.2",
    "reflect-metadata": "~0.1.8",
    "rxjs": "^5.5.0",
    "tns-core-modules": "next",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "babel-traverse": "6.4.5",
    "babel-types": "6.4.5",
    "babylon": "6.4.5",
    "lazy": "1.0.11",
    "nativescript-dev-typescript": "~0.4.0",
    "typescript": "~2.4.2"
  }
}

@bzaruk
Copy link

bzaruk commented Jan 8, 2018

+1

@buuhuu
Copy link
Contributor

buuhuu commented Jun 8, 2018

+1 Still an issue with 6.0.0.

I think the issue is that the tabItem directive has multiple inputs, which cannot be uniquely associated to this directive when it is used on a non-html element (an angular component). The only one that works is the one for config directly named "tabItem" which, though, doesn't implement a setter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants