@@ -358,28 +358,28 @@ export class CdkListbox<T = unknown>
358
358
* Whether the keyboard navigation should wrap when the user presses arrow down on the last item
359
359
* or arrow up on the first item.
360
360
*/
361
- @Input ( 'cdkListboxKeyboardNavigationWraps ' )
362
- get keyboardNavigationWraps ( ) {
363
- return this . _keyboardNavigationWraps ;
361
+ @Input ( 'cdkListboxNavigationWrapDisabled ' )
362
+ get navigationWrapDisabled ( ) {
363
+ return this . _navigationWrapDisabled ;
364
364
}
365
- set keyboardNavigationWraps ( wrap : BooleanInput ) {
366
- this . _keyboardNavigationWraps = coerceBooleanProperty ( wrap ) ;
367
- this . listKeyManager ?. withWrap ( this . _keyboardNavigationWraps ) ;
365
+ set navigationWrapDisabled ( wrap : BooleanInput ) {
366
+ this . _navigationWrapDisabled = coerceBooleanProperty ( wrap ) ;
367
+ this . listKeyManager ?. withWrap ( ! this . _navigationWrapDisabled ) ;
368
368
}
369
- private _keyboardNavigationWraps = true ;
369
+ private _navigationWrapDisabled = false ;
370
370
371
371
/** Whether keyboard navigation should skip over disabled items. */
372
- @Input ( 'cdkListboxKeyboardNavigationSkipsDisabled ' )
373
- get keyboardNavigationSkipsDisabled ( ) {
374
- return this . _keyboardNavigationSkipsDisabled ;
372
+ @Input ( 'cdkListboxNavigatesDisabledOptions ' )
373
+ get navigateDisabledOptions ( ) {
374
+ return this . _navigateDisabledOptions ;
375
375
}
376
- set keyboardNavigationSkipsDisabled ( skip : BooleanInput ) {
377
- this . _keyboardNavigationSkipsDisabled = coerceBooleanProperty ( skip ) ;
376
+ set navigateDisabledOptions ( skip : BooleanInput ) {
377
+ this . _navigateDisabledOptions = coerceBooleanProperty ( skip ) ;
378
378
this . listKeyManager ?. skipPredicate (
379
- this . _keyboardNavigationSkipsDisabled ? this . _skipDisabledPredicate : this . _skipNonePredicate ,
379
+ this . _navigateDisabledOptions ? this . _skipNonePredicate : this . _skipDisabledPredicate ,
380
380
) ;
381
381
}
382
- private _keyboardNavigationSkipsDisabled = true ;
382
+ private _navigateDisabledOptions = false ;
383
383
384
384
/** Emits when the selected value(s) in the listbox change. */
385
385
@Output ( 'cdkListboxValueChange' ) readonly valueChange = new Subject < ListboxValueChangeEvent < T > > ( ) ;
@@ -860,14 +860,12 @@ export class CdkListbox<T = unknown>
860
860
/** Initialize the key manager. */
861
861
private _initKeyManager ( ) {
862
862
this . listKeyManager = new ActiveDescendantKeyManager ( this . options )
863
- . withWrap ( this . _keyboardNavigationWraps )
863
+ . withWrap ( ! this . _navigationWrapDisabled )
864
864
. withTypeAhead ( )
865
865
. withHomeAndEnd ( )
866
866
. withAllowedModifierKeys ( [ 'shiftKey' ] )
867
867
. skipPredicate (
868
- this . _keyboardNavigationSkipsDisabled
869
- ? this . _skipDisabledPredicate
870
- : this . _skipNonePredicate ,
868
+ this . _navigateDisabledOptions ? this . _skipNonePredicate : this . _skipDisabledPredicate ,
871
869
) ;
872
870
873
871
if ( this . orientation === 'vertical' ) {
0 commit comments