File tree Expand file tree Collapse file tree
packages/lib/src/spatial-navigation/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ type DefaultProps = {
4040 onFocus ?: ( ) => void ;
4141 onBlur ?: ( ) => void ;
4242 onSelect ?: ( ) => void ;
43+ onLongSelect ?: ( ) => void ;
4344 onActive ?: ( ) => void ;
4445 onInactive ?: ( ) => void ;
4546 orientation ?: NodeOrientation ;
@@ -101,6 +102,7 @@ export const SpatialNavigationNode = forwardRef<SpatialNavigationNodeRef, Props>
101102 onFocus,
102103 onBlur,
103104 onSelect,
105+ onLongSelect = onSelect ,
104106 onActive,
105107 onInactive,
106108 orientation = 'vertical' ,
@@ -144,6 +146,9 @@ export const SpatialNavigationNode = forwardRef<SpatialNavigationNodeRef, Props>
144146 const currentOnSelect = useRef < ( ) => void > ( ) ;
145147 currentOnSelect . current = onSelect ;
146148
149+ const currentOnLongSelect = useRef < ( ) => void > ( ) ;
150+ currentOnLongSelect . current = onLongSelect ;
151+
147152 const currentOnFocus = useRef < ( ) => void > ( ) ;
148153 currentOnFocus . current = ( ) => {
149154 onFocus ?.( ) ;
@@ -174,6 +179,7 @@ export const SpatialNavigationNode = forwardRef<SpatialNavigationNodeRef, Props>
174179 setIsFocused ( true ) ;
175180 } ,
176181 onSelect : ( ) => currentOnSelect . current ?.( ) ,
182+ onLongSelect : ( ) => currentOnLongSelect . current ?.( ) ,
177183 orientation,
178184 isIndexAlign : alignInGrid ,
179185 indexRange,
You can’t perform that action at this time.
0 commit comments