|
1 | 1 | import * as React from 'react'; |
2 | | -import { FocusZone, FocusTrapZone, FocusZoneDirection, mergeStyles } from '@fluentui/react'; |
3 | | - |
4 | | -const rootClass = mergeStyles({ |
5 | | - position: 'relative', |
6 | | - button: { position: 'absolute', height: 30, width: 30 }, |
7 | | - '#a': { top: 0, left: 0 }, |
8 | | - '#b': { top: 0, left: 30 }, |
9 | | - '#c': { top: 0, left: 60 }, |
10 | | - '#d': { top: 30, left: 0 }, |
11 | | - '#e': { top: 30, left: 30 }, |
12 | | - '#f': { top: 30, left: 60 }, |
13 | | -}); |
| 2 | +import { FocusZone, FocusTrapZone, FocusZoneDirection } from '@fluentui/react'; |
| 3 | +import { rootClass } from './shared'; |
14 | 4 |
|
15 | 5 | /** |
16 | 6 | * Tab and shift-tab wrap at extreme ends of the FTZ: |
17 | 7 | * |
18 | | - * can tab across FocusZones with different button structures |
| 8 | + * can tab between multiple FocusZones with different button structures |
19 | 9 | */ |
20 | 10 | export const TabWrappingMultiFocusZone = () => { |
21 | 11 | return ( |
22 | 12 | <div className={rootClass}> |
23 | 13 | <FocusTrapZone forceFocusInsideTrap={false}> |
24 | 14 | <FocusZone direction={FocusZoneDirection.horizontal}> |
25 | 15 | <div> |
26 | | - <button id="a">a</button> |
| 16 | + <button>fz1First</button> |
27 | 17 | </div> |
28 | 18 | <div> |
29 | | - <button id="b">b</button> |
| 19 | + <button>fz1Mid</button> |
30 | 20 | </div> |
31 | 21 | <div> |
32 | | - <button id="c">c</button> |
| 22 | + <button>fz1Last</button> |
33 | 23 | </div> |
34 | 24 | </FocusZone> |
35 | 25 | <FocusZone direction={FocusZoneDirection.horizontal}> |
36 | 26 | <div> |
37 | 27 | <div> |
38 | | - <button id="d">d</button> |
39 | | - <button id="e">e</button> |
40 | | - <button id="f">f</button> |
| 28 | + <button>fz2First</button> |
| 29 | + <button>fz2Mid</button> |
| 30 | + <button>fz2Last</button> |
41 | 31 | </div> |
42 | 32 | </div> |
43 | 33 | </FocusZone> |
|
0 commit comments