@@ -37,7 +37,7 @@ export type NodeType = NodeTypeOverrides extends { node: infer N }
3737
3838export type Direction = 'up' | 'down' | 'left' | 'right' ;
3939
40- export type NavigationStrategy = (
40+ export type NextFocusResolver = (
4141 direction : Direction ,
4242 focusKey : string ,
4343 siblings : FocusableComponent [ ]
@@ -118,7 +118,7 @@ export interface FocusableComponent {
118118 focusBoundaryDirections ?: Direction [ ] ;
119119 autoRestoreFocus : boolean ;
120120 forceFocus : boolean ;
121- navigationStrategy ?: NavigationStrategy ;
121+ nextFocusResolver ?: NextFocusResolver ;
122122 lastFocusedChildKey ?: string ;
123123 layout ?: FocusableComponentLayout ;
124124 layoutUpdatedAt ?: number ;
@@ -136,7 +136,7 @@ interface FocusableComponentUpdatePayload {
136136 onArrowRelease : ( direction : string ) => void ;
137137 onFocus : ( layout : FocusableComponentLayout , details : FocusDetails ) => void ;
138138 onBlur : ( layout : FocusableComponentLayout , details : FocusDetails ) => void ;
139- navigationStrategy ?: NavigationStrategy ;
139+ nextFocusResolver ?: NextFocusResolver ;
140140}
141141
142142interface FocusableComponentRemovePayload {
@@ -1129,16 +1129,16 @@ export class SpatialNavigationService {
11291129
11301130 let nextComponent : FocusableComponent | null = null ;
11311131
1132- const { navigationStrategy } =
1132+ const { nextFocusResolver } =
11331133 this . focusableComponents [ parentFocusKey ] ?? { } ;
11341134
1135- if ( navigationStrategy ) {
1135+ if ( nextFocusResolver ) {
11361136 const siblings = filter (
11371137 this . focusableComponents ,
11381138 ( component ) =>
11391139 component . parentFocusKey === parentFocusKey && component . focusable
11401140 ) ;
1141- nextComponent = navigationStrategy (
1141+ nextComponent = nextFocusResolver (
11421142 direction as Direction ,
11431143 focusKey ,
11441144 siblings
@@ -1147,7 +1147,7 @@ export class SpatialNavigationService {
11471147 if ( this . debug ) {
11481148 this . log (
11491149 'smartNavigate' ,
1150- 'navigation overrided by navigationStrategy ' ,
1150+ 'navigation overrided by nextFocusResolver ' ,
11511151 nextComponent
11521152 ) ;
11531153 }
@@ -1425,7 +1425,7 @@ export class SpatialNavigationService {
14251425 focusable,
14261426 isFocusBoundary,
14271427 focusBoundaryDirections,
1428- navigationStrategy
1428+ nextFocusResolver
14291429 } : FocusableComponent ) {
14301430 this . focusableComponents [ focusKey ] = {
14311431 focusKey,
@@ -1439,7 +1439,7 @@ export class SpatialNavigationService {
14391439 onBlur,
14401440 onUpdateFocus,
14411441 onUpdateHasFocusedChild,
1442- navigationStrategy ,
1442+ nextFocusResolver ,
14431443 saveLastFocusedChild,
14441444 trackChildren,
14451445 preferredChildFocusKey,
@@ -1807,7 +1807,7 @@ export class SpatialNavigationService {
18071807 onArrowPress,
18081808 onFocus,
18091809 onBlur,
1810- navigationStrategy
1810+ nextFocusResolver
18111811 } : FocusableComponentUpdatePayload
18121812 ) {
18131813 const component = this . focusableComponents [ focusKey ] ;
@@ -1822,7 +1822,7 @@ export class SpatialNavigationService {
18221822 component . onArrowPress = onArrowPress ;
18231823 component . onFocus = onFocus ;
18241824 component . onBlur = onBlur ;
1825- component . navigationStrategy = navigationStrategy ;
1825+ component . nextFocusResolver = nextFocusResolver ;
18261826 // Reset layout updated at to force a layout update
18271827 component . layoutUpdatedAt = 0 ;
18281828
0 commit comments