@@ -220,7 +220,54 @@ const FocusZoneTextInput: React.FunctionComponent = () => {
220220 ) ;
221221} ;
222222
223+ export const FirstFocusTest = ( ) => {
224+ const outerNormalRef = React . useRef ( null ) ;
225+ const innerNormalRef = React . useRef ( null ) ;
226+ const innerDirectRef = React . useRef ( null ) ;
227+ const innerFZRef = React . useRef ( null ) ;
228+ const outerNativeID = 'nativeIDToOuterButton' ;
229+ const innerNativeID = 'nativeIDToInnerButton' ;
230+ const innerDirectNativeID = 'nativeIDDirectToInnerButton' ;
231+ const [ outerFocusZoneTabbableElement , setOuterFocusZoneTabbableElement ] = React . useState < React . RefObject < View > | string > ( ) ;
232+ const [ innerFocusZoneTabbableElement , setInnerFocusZoneTabbableElement ] = React . useState < React . RefObject < View > | string > ( ) ;
233+
234+ return (
235+ < FocusZone defaultTabbableElement = { outerFocusZoneTabbableElement } tabKeyNavigation = "Normal" >
236+ < View >
237+ < Button onClick = { ( ) => setOuterFocusZoneTabbableElement ( undefined ) } > clear OuterFocusZone</ Button >
238+ < Button componentRef = { outerNormalRef } onClick = { ( ) => setOuterFocusZoneTabbableElement ( outerNormalRef ) } >
239+ Test ref
240+ </ Button >
241+ < Button nativeID = { outerNativeID } onClick = { ( ) => setOuterFocusZoneTabbableElement ( outerNativeID ) } >
242+ Test nativeId
243+ </ Button >
244+ </ View >
245+ < FocusZone componentRef = { innerFZRef } defaultTabbableElement = { innerFocusZoneTabbableElement } >
246+ < Button onClick = { ( ) => setInnerFocusZoneTabbableElement ( undefined ) } > clear InnerFocusZone</ Button >
247+ < Button componentRef = { innerDirectRef } onClick = { ( ) => setOuterFocusZoneTabbableElement ( innerDirectRef ) } >
248+ Test nested (direct ref)
249+ </ Button >
250+ < Button nativeID = { innerDirectNativeID } onClick = { ( ) => setOuterFocusZoneTabbableElement ( innerDirectNativeID ) } >
251+ Test nested (direct nativeID)
252+ </ Button >
253+ < Button componentRef = { innerNormalRef } onClick = { ( ) => setInnerFocusZoneTabbableElement ( innerNormalRef ) } >
254+ Test inner zone (ref)
255+ </ Button >
256+ < Button nativeID = { innerNativeID } onClick = { ( ) => setInnerFocusZoneTabbableElement ( innerNativeID ) } >
257+ Test inner zone (nativeID)
258+ </ Button >
259+ < Button onClick = { ( ) => setOuterFocusZoneTabbableElement ( innerFZRef ) } > Test nested (transitive)</ Button >
260+ </ FocusZone >
261+ </ FocusZone >
262+ ) ;
263+ } ;
264+
223265const focusZoneSections : TestSection [ ] = [
266+ {
267+ name : 'First Focus FocusZone Usage' ,
268+ component : FirstFocusTest ,
269+ testID : FOCUSZONE_TESTPAGE ,
270+ } ,
224271 {
225272 name : 'Common FocusZone Usage' ,
226273 component : CommonUsageFocusZone ,
0 commit comments