@@ -10,6 +10,7 @@ import {
10
10
Injector ,
11
11
input ,
12
12
InputSignal ,
13
+ linkedSignal ,
13
14
OnInit ,
14
15
runInInjectionContext ,
15
16
signal ,
@@ -47,16 +48,9 @@ export class TabDirective implements FocusableOption, OnInit {
47
48
*/
48
49
readonly disabledInput = input ( false , { transform : booleanAttribute , alias : 'disabled' } ) ;
49
50
50
- readonly #disabled = signal ( false ) ;
51
+ readonly #disabled = linkedSignal ( this . disabledInput ) ;
51
52
readonly attrDisabled = computed ( ( ) => this . #disabled( ) || null ) ;
52
53
53
- readonly #disabledEffect = effect ( ( ) => {
54
- const disabled = this . disabledInput ( ) ;
55
- untracked ( ( ) => {
56
- this . disabled = disabled ;
57
- } ) ;
58
- } ) ;
59
-
60
54
set disabled ( value : boolean ) {
61
55
this . #disabled. set ( value ) ;
62
56
}
@@ -90,11 +84,13 @@ export class TabDirective implements FocusableOption, OnInit {
90
84
91
85
readonly isActive = signal ( false ) ;
92
86
93
- readonly hostClasses = computed ( ( ) => ( {
94
- 'nav-link' : true ,
95
- active : this . isActive ( ) ,
96
- disabled : this . #disabled( )
97
- } ) as Record < string , boolean > ) ;
87
+ readonly hostClasses = computed ( ( ) => {
88
+ return {
89
+ 'nav-link' : true ,
90
+ active : this . isActive ( ) ,
91
+ disabled : this . #disabled( )
92
+ } as Record < string , boolean > ;
93
+ } ) ;
98
94
99
95
readonly propId = computed ( ( ) => this . id ( ) ?? `${ this . #tabsService. id ( ) } -tab-${ this . itemKey ( ) } ` ) ;
100
96
0 commit comments