File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/cdk-experimental/listbox Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 77 */
88
99import {
10+ AfterViewInit ,
1011 booleanAttribute ,
1112 computed ,
1213 contentChildren ,
@@ -54,7 +55,7 @@ import {_IdGenerator} from '@angular/cdk/a11y';
5455 '(focusin)' : 'onFocus()' ,
5556 } ,
5657} )
57- export class CdkListbox < V > {
58+ export class CdkListbox < V > implements AfterViewInit {
5859 /** The directionality (LTR / RTL) context for the application (or a subtree of it). */
5960 private readonly _directionality = inject ( Directionality ) ;
6061
@@ -110,26 +111,26 @@ export class CdkListbox<V> {
110111 } ) ;
111112
112113 /** Whether the listbox has received focus yet. */
113- private touched = signal ( false ) ;
114+ private _touched = signal ( false ) ;
114115
115116 /** Whether the options in the listbox have been initialized. */
116- private isViewInitialized = signal ( false ) ;
117+ private _isViewInitialized = signal ( false ) ;
117118
118119 constructor ( ) {
119120 effect ( ( ) => {
120- if ( this . isViewInitialized ( ) && ! this . touched ( ) ) {
121+ if ( this . _isViewInitialized ( ) && ! this . _touched ( ) ) {
121122 const index = this . items ( ) . findIndex ( i => this . value ( ) . includes ( i . value ( ) ) ) ;
122123 this . activeIndex . set ( Math . max ( index , 0 ) ) ;
123124 }
124125 } ) ;
125126 }
126127
127128 ngAfterViewInit ( ) {
128- this . isViewInitialized . set ( true ) ;
129+ this . _isViewInitialized . set ( true ) ;
129130 }
130131
131132 onFocus ( ) {
132- this . touched . set ( true ) ;
133+ this . _touched . set ( true ) ;
133134 }
134135}
135136
You can’t perform that action at this time.
0 commit comments