Skip to content

Commit

Permalink
fix: TabItem create undefined Link ID when id is set with binding (si…
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjenni authored Aug 31, 2024
1 parent 238b899 commit 0aff55c
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<h2>Tabs</h2>
<form #myForm="sacform" labelsize="3">

<sac-tab name="tab1">
<sac-tabitem id="home1" label="Home">
<ng-template>
Expand Down Expand Up @@ -47,4 +46,16 @@ <h2>Tabs</h2>
</sac-tabitem>
</sac-tab>

</form>
<sac-tab name="tab3">
<sac-tabitem
id="tab_{{ item }}"
[label]="item"
[active]="i === 0 ? true : false"
*ngFor="let item of languages; index as i"
>
<ng-template>
<p>Tab Content here {{ i }}</p>
</ng-template>
</sac-tabitem>
</sac-tab>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ import { Component } from '@angular/core';
templateUrl: './tabs.component.html',
})
export class DemoTabsComponent {
// #region Properties

public languages = ['de', 'fr', 'it'];

// #endregion Properties
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,17 @@ <h2>Tabs</h2>
</ng-template>
</sac-tabitem>
</sac-tab>

<sac-tab name="tab3">
<sac-tabitem
id="tab_{{ item }}"
[label]="item"
[active]="i === 0 ? true : false"
*ngFor="let item of languages; index as i"
>
<ng-template>
<p>Tab Content here {{ i }}</p>
</ng-template>
</sac-tabitem>
</sac-tab>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ import { Component } from '@angular/core';
selector: 'app-tabs',
templateUrl: './tabs.component.html',
})
export class DemoTabsComponent {}
export class DemoTabsComponent {
// #region Properties

public languages = ['de', 'fr', 'it'];

// #endregion Properties
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,17 @@ <h2>Tabs</h2>
</ng-template>
</sac-tabitem>
</sac-tab>

<sac-tab name="tab3">
<sac-tabitem
id="tab_{{ item }}"
[label]="item"
[active]="i === 0 ? true : false"
*ngFor="let item of languages; index as i"
>
<ng-template>
<p>Tab Content here {{ i }}</p>
</ng-template>
</sac-tabitem>
</sac-tab>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ import { Component } from '@angular/core';
selector: 'app-tabs',
templateUrl: './tabs.component.html',
})
export class DemoTabsComponent {}
export class DemoTabsComponent {
// #region Properties

public languages = ['de', 'fr', 'it'];

// #endregion Properties
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
(click)="selectTab(item)"
[ngStyle]="{'cursor': item._disabled ? 'not-allowed' : 'pointer'}"
>
<a [id]="GetTabItemButtonId(item._id)" role="tab">
<a [id]="GetTabItemButtonId(item.id)" role="tab">
<ng-template
*ngTemplateOutlet="tablabeltemplate || defaultTabLabelTemplate;context:{ label: item.label }"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<div class="nav nav-tabs" role="tablist">
<a
*ngFor="let item of _tabItems"
[id]="GetTabItemButtonId(item.id)"
role="tab"
class="nav-item nav-link active"
data-toggle="tab"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" *ngFor="let item of _tabItems">
<a
[id]="GetTabItemButtonId(item.id)"
role="tab"
class="nav-link"
data-toggle="tab"
Expand Down

0 comments on commit 0aff55c

Please sign in to comment.