Skip to content

Commit 94cfe7e

Browse files
committed
try linkedSignal again
1 parent 9a505e1 commit 94cfe7e

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/aria/tabs/tab-list.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
effect,
2020
inject,
2121
input,
22+
linkedSignal,
2223
model,
2324
signal,
2425
} from '@angular/core';
@@ -111,7 +112,13 @@ export class TabList implements OnInit, OnDestroy {
111112
readonly selectedTab = model<string | undefined>();
112113

113114
/** The current selected Tab pattern, passed to the List pattern. */
114-
private readonly _selectedTabPattern: WritableSignal<TabPattern | undefined> = signal(undefined);
115+
private readonly _selectedTabPattern: WritableSignal<TabPattern | undefined> = linkedSignal(
116+
() => {
117+
const tab = this.findTab(this.selectedTab());
118+
119+
return tab?._pattern;
120+
},
121+
);
115122

116123
/** Whether the tablist is disabled. */
117124
readonly disabled = input(false, {transform: booleanAttribute});
@@ -126,11 +133,11 @@ export class TabList implements OnInit, OnDestroy {
126133
});
127134

128135
constructor() {
129-
effect(() => {
136+
/*effect(() => {
130137
const tab = this.findTab(this.selectedTab());
131138
132139
this._selectedTabPattern.set(tab?._pattern);
133-
});
140+
});*/
134141

135142
effect(() => {
136143
const pattern = this._selectedTabPattern();

0 commit comments

Comments
 (0)