7
7
*/
8
8
9
9
import {
10
+ afterRenderEffect ,
10
11
AfterViewInit ,
11
12
booleanAttribute ,
12
13
computed ,
13
14
contentChildren ,
14
15
Directive ,
15
- effect ,
16
16
ElementRef ,
17
17
inject ,
18
18
input ,
@@ -56,7 +56,7 @@ import {_IdGenerator} from '@angular/cdk/a11y';
56
56
'(focusin)' : 'onFocus()' ,
57
57
} ,
58
58
} )
59
- export class CdkRadioGroup < V > implements AfterViewInit {
59
+ export class CdkRadioGroup < V > {
60
60
/** The directionality (LTR / RTL) context for the application (or a subtree of it). */
61
61
private readonly _directionality = inject ( Directionality ) ;
62
62
@@ -74,9 +74,6 @@ export class CdkRadioGroup<V> implements AfterViewInit {
74
74
/** Whether the radio group is vertically or horizontally oriented. */
75
75
orientation = input < 'vertical' | 'horizontal' > ( 'horizontal' ) ;
76
76
77
- /** Whether focus should wrap when navigating. */
78
- wrap = input ( false , { transform : booleanAttribute } ) ; // Radio groups typically don't wrap
79
-
80
77
/** Whether disabled items in the group should be skipped when navigating. */
81
78
skipDisabled = input ( true , { transform : booleanAttribute } ) ;
82
79
@@ -111,17 +108,13 @@ export class CdkRadioGroup<V> implements AfterViewInit {
111
108
private _isViewInitialized = signal ( false ) ;
112
109
113
110
constructor ( ) {
114
- effect ( ( ) => {
115
- if ( this . _isViewInitialized ( ) && ! this . _hasFocused ( ) ) {
111
+ afterRenderEffect ( ( ) => {
112
+ if ( ! this . _hasFocused ( ) ) {
116
113
this . pattern . setDefaultState ( ) ;
117
114
}
118
115
} ) ;
119
116
}
120
117
121
- ngAfterViewInit ( ) {
122
- this . _isViewInitialized . set ( true ) ;
123
- }
124
-
125
118
onFocus ( ) {
126
119
this . _hasFocused . set ( true ) ;
127
120
}
0 commit comments