File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -116,8 +116,7 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> {
116
116
* Predicate function that can be used to check whether an item should be skipped
117
117
* by the key manager. By default, disabled items are skipped.
118
118
*/
119
- private _skipPredicateFn = ( item : T ) =>
120
- typeof item . isDisabled === 'boolean' ? item . isDisabled : ! ! item . isDisabled ?.( ) ;
119
+ private _skipPredicateFn = ( item : T ) => this . _isItemDisabled ( item ) ;
121
120
122
121
/** Function to determine equivalent items. */
123
122
private _trackByFn : ( item : T ) => unknown = ( item : T ) => item ;
@@ -337,7 +336,7 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> {
337
336
this . _activeItem . collapse ( ) ;
338
337
} else {
339
338
const parent = this . _activeItem . getParent ( ) ;
340
- if ( ! parent || this . _isItemDisabled ( parent ) ) {
339
+ if ( ! parent || this . _skipPredicateFn ( parent as T ) ) {
341
340
return ;
342
341
}
343
342
this . _setActiveItem ( parent as T ) ;
@@ -358,7 +357,7 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> {
358
357
coerceObservable ( this . _activeItem . getChildren ( ) )
359
358
. pipe ( take ( 1 ) )
360
359
. subscribe ( children => {
361
- const firstChild = children . find ( child => ! this . _isItemDisabled ( child ) ) ;
360
+ const firstChild = children . find ( child => ! this . _skipPredicateFn ( child as T ) ) ;
362
361
if ( ! firstChild ) {
363
362
return ;
364
363
}
You can’t perform that action at this time.
0 commit comments