@@ -30,6 +30,8 @@ function getItems(count, height) {
30
30
const Handle = SortableHandle ( ( ) => < div className = { style . handle } /> ) ;
31
31
32
32
const Item = SortableElement ( ( props ) => {
33
+ const tabIndex = props . tabbable ? 0 : - 1 ;
34
+
33
35
return (
34
36
< div
35
37
className = { props . className }
@@ -39,7 +41,7 @@ const Item = SortableElement((props) => {
39
41
} }
40
42
>
41
43
{ props . shouldUseDragHandle && < Handle /> }
42
- < div className = { style . wrapper } >
44
+ < div className = { style . wrapper } tabIndex = { tabIndex } >
43
45
< span > Item</ span > { props . value }
44
46
</ div >
45
47
</ div >
@@ -52,6 +54,7 @@ const SortableList = SortableContainer(
52
54
< div className = { className } >
53
55
{ items . map ( ( { value, height} , index ) => (
54
56
< Item
57
+ tabbable
55
58
key = { `item-${ value } ` }
56
59
className = { itemClass }
57
60
index = { index }
@@ -86,11 +89,13 @@ class SortableListWithCustomContainer extends React.Component {
86
89
}
87
90
88
91
const Category = SortableElement ( ( props ) => {
92
+ const tabIndex = props . tabbable ? 0 : - 1 ;
93
+
89
94
return (
90
95
< div className = { style . category } >
91
96
< div className = { style . categoryHeader } >
92
97
< Handle />
93
- < span > Category { props . value } </ span >
98
+ < span tabIndex = { tabIndex } > Category { props . value } </ span >
94
99
</ div >
95
100
< ListWrapper
96
101
component = { SortableList }
@@ -178,6 +183,7 @@ const SortableVirtualList = SortableContainer(
178
183
const { value, height} = items [ index ] ;
179
184
return (
180
185
< Item
186
+ tabbable
181
187
key = { value }
182
188
index = { index }
183
189
className = { itemClass }
@@ -209,6 +215,7 @@ class VirtualizedListWrapper extends Component {
209
215
const { value, height} = items [ index ] ;
210
216
return (
211
217
< Item
218
+ tabbable
212
219
key = { value }
213
220
index = { index }
214
221
className = { itemClass }
@@ -289,6 +296,7 @@ const SortableInfiniteList = SortableContainer(
289
296
>
290
297
{ items . map ( ( { value, height} , index ) => (
291
298
< Item
299
+ tabbable
292
300
key = { `item-${ index } ` }
293
301
className = { itemClass }
294
302
index = { index }
@@ -307,6 +315,7 @@ const ShrinkingSortableList = SortableContainer(
307
315
< div className = { className } >
308
316
{ items . map ( ( { value, height} , index ) => (
309
317
< Item
318
+ tabbable
310
319
key = { `item-${ value } ` }
311
320
className = { itemClass }
312
321
index = { index }
@@ -325,7 +334,7 @@ const NestedSortableList = SortableContainer(
325
334
return (
326
335
< div className = { className } >
327
336
{ items . map ( ( value , index ) => (
328
- < Category key = { `category-${ value } ` } index = { index } value = { value } />
337
+ < Category tabbable key = { `category-${ value } ` } index = { index } value = { value } />
329
338
) ) }
330
339
</ div >
331
340
) ;
0 commit comments