Skip to content

Commit 49b5ea6

Browse files
committed
fix(tabs-list): allowSignalWrites for tabsService effect
1 parent b2abbd4 commit 49b5ea6

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

projects/coreui-angular/src/lib/tabs-2/tabs-list/tabs-list.component.ts

+10-7
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { TabsService } from '../tabs.service';
2020
exportAs: 'cTabsList',
2121
selector: 'c-tabs-list',
2222
standalone: true,
23-
imports: [TabDirective],
23+
imports: [],
2424
template: '<ng-content />',
2525
host: {
2626
'[attr.role]': 'role()',
@@ -90,12 +90,15 @@ export class TabsListComponent {
9090
{ allowSignalWrites: true }
9191
);
9292

93-
tabsServiceEffect = effect(() => {
94-
const activeItemIndex = this.tabs().findIndex(
95-
(tab) => untracked(tab.isActive) && untracked(tab.itemKey) === this.tabsService.activeItemKey()
96-
);
97-
this.#focusKeyManager?.updateActiveItem(activeItemIndex < 0 ? 0 : activeItemIndex);
98-
});
93+
tabsServiceEffect = effect(
94+
() => {
95+
const activeItemIndex = this.tabs().findIndex(
96+
(tab) => untracked(tab.isActive) && untracked(tab.itemKey) === this.tabsService.activeItemKey()
97+
);
98+
this.#focusKeyManager?.updateActiveItem(activeItemIndex < 0 ? 0 : activeItemIndex);
99+
},
100+
{ allowSignalWrites: true }
101+
);
99102

100103
@HostListener('keydown', ['$event'])
101104
onKeydown($event: any) {

0 commit comments

Comments
 (0)