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> {
116116 * Predicate function that can be used to check whether an item should be skipped
117117 * by the key manager. By default, disabled items are skipped.
118118 */
119- private _skipPredicateFn = ( item : T ) =>
120- typeof item . isDisabled === 'boolean' ? item . isDisabled : ! ! item . isDisabled ?.( ) ;
119+ private _skipPredicateFn = ( item : T ) => this . _isItemDisabled ( item ) ;
121120
122121 /** Function to determine equivalent items. */
123122 private _trackByFn : ( item : T ) => unknown = ( item : T ) => item ;
@@ -337,7 +336,7 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> {
337336 this . _activeItem . collapse ( ) ;
338337 } else {
339338 const parent = this . _activeItem . getParent ( ) ;
340- if ( ! parent || this . _isItemDisabled ( parent ) ) {
339+ if ( ! parent || this . _skipPredicateFn ( parent as T ) ) {
341340 return ;
342341 }
343342 this . _setActiveItem ( parent as T ) ;
@@ -358,7 +357,7 @@ export class TreeKeyManager<T extends TreeKeyManagerItem> {
358357 coerceObservable ( this . _activeItem . getChildren ( ) )
359358 . pipe ( take ( 1 ) )
360359 . subscribe ( children => {
361- const firstChild = children . find ( child => ! this . _isItemDisabled ( child ) ) ;
360+ const firstChild = children . find ( child => ! this . _skipPredicateFn ( child as T ) ) ;
362361 if ( ! firstChild ) {
363362 return ;
364363 }
You can’t perform that action at this time.
0 commit comments