@@ -216,6 +216,8 @@ class RowItem extends Component {
216216 subItemsFlatListProps
217217 } = this . props
218218 const hasDropDown = item [ subKey ] && item [ subKey ] . length > 0 && showDropDowns
219+ const itemSelected = this . _itemSelected ( item )
220+ const showSubCategoryDropDown = this . _showSubCategoryDropDown ( )
219221
220222 return (
221223 < View >
@@ -230,6 +232,8 @@ class RowItem extends Component {
230232 < TouchableOpacity
231233 disabled = { ( readOnlyHeadings && ! showDropDowns ) || item . disabled }
232234 onPress = { this . _dropDownOrToggle }
235+ accessibilityState = { { selected : itemSelected } }
236+ accessibilityRole = { readOnlyHeadings ? 'header' : 'menuitem' }
233237 style = { [
234238 {
235239 flex : 1 ,
@@ -239,7 +243,7 @@ class RowItem extends Component {
239243 paddingVertical : 6
240244 } ,
241245 mergedStyles . item ,
242- this . _itemSelected ( item ) && mergedStyles . selectedItem
246+ itemSelected && mergedStyles . selectedItem
243247 ] }
244248 >
245249 { selectedIconOnLeft && this . _renderSelectedIcon ( ) }
@@ -280,9 +284,10 @@ class RowItem extends Component {
280284 } ,
281285 mergedStyles . toggleIcon
282286 ] }
287+ accessibilityState = { { expanded : showSubCategoryDropDown } }
283288 onPress = { this . _toggleDropDown }
284289 >
285- { this . _showSubCategoryDropDown ( ) ? (
290+ { showSubCategoryDropDown ? (
286291 < View >
287292 { callIfFunction ( dropDownToggleIconUpComponent ) || (
288293 < Icon
@@ -308,7 +313,7 @@ class RowItem extends Component {
308313 </ TouchableOpacity >
309314 ) }
310315 </ View >
311- { item [ subKey ] && this . _showSubCategoryDropDown ( ) && (
316+ { item [ subKey ] && showSubCategoryDropDown && (
312317 < FlatList
313318 keyExtractor = { ( i ) => `${ i [ uniqueKey ] } ` }
314319 data = { item [ subKey ] }
0 commit comments