Skip to content

Commit

Permalink
Fixing type flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
fabOnReact committed Feb 26, 2022
1 parent e36b261 commit 32676eb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
16 changes: 16 additions & 0 deletions Libraries/Components/View/ViewPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,22 @@ export type ViewProps = $ReadOnly<{|
*/
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,

/**
* Prop used internally to announce with TalkBack rows and columns of a FlatList
* See https://bit.ly/3viYSh8
*
* @platform android
*
*/
accessibilityCollectionItem?: ?{
rowIndex: number,
rowSpan: number,
columnIndex: number,
columnSpan: number,
heading: boolean,
itemIndex: number,
},

/**
* Specifies the nativeID of the associated label text. When the assistive technology focuses on the component with this props, the text is read aloud.
*
Expand Down
7 changes: 2 additions & 5 deletions Libraries/Lists/FlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,10 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
};

_getAccessibilityCollection = () => {
const _getItemCountInternal = (data: any): number => {
return this._getItemCount(data);
};

const accessibilityCollectionProps = {
itemCount: this.props.data ? this.props.data.length : 0,
rowCount: _getItemCountInternal(this.props.data),
//$FlowFixMe[incompatible-call]
rowCount: this._getItemCount(this.props.data),
columnCount: numColumnsOrDefault(this.props.numColumns),
hierarchical: false,
};
Expand Down

0 comments on commit 32676eb

Please sign in to comment.