diff --git a/docs/flatlist.md b/docs/flatlist.md index 0398e1181c3..c817f303947 100644 --- a/docs/flatlist.md +++ b/docs/flatlist.md @@ -181,7 +181,12 @@ Inherits [ScrollView Props](scrollview.md#props), unless it is nested in another ###
Required
**`renderItem`** ```jsx -renderItem({ item, index, separators }); +renderItem({ + item, + index, + separators, + accessibilityCollectionItem +}); ``` Takes an item from `data` and renders it into the list. @@ -200,6 +205,14 @@ Provides additional metadata like `index` if you need it, as well as a more gene - `updateProps` (Function) - `select` (enum('leading', 'trailing')) - `newProps` (Object) +- `accessibilityCollectionItem` (Object): + Used by TalkBack to announce the position of the item of a collection (row and column numbers). A collection item is contained in a collection, it starts at a given row and column in the collection, and spans one or more rows and columns. For example, a header of two related table columns starts at the first row and the first column, spans one row and two columns. + - itemIndex The index of the item in the collection (index of prop.data). + - rowIndex The row index at which the item is located. + - rowSpan The number of rows the item spans. + - columnIndex The column index at which the item is located. + - columnSpan The number of columns the item spans. + - heading Whether the item is a heading. Example usage: @@ -217,13 +230,21 @@ Example usage: )) } data={[{ title: 'Title Text', key: 'item1' }]} - renderItem={({ item, index, separators }) => ( + renderItem={({ + item, + index, + separators, + accessibilityCollectionItem + }) => ( this._onPress(item)} onShowUnderlay={separators.highlight} onHideUnderlay={separators.unhighlight}> - + {item.title} diff --git a/docs/virtualizedlist.md b/docs/virtualizedlist.md index b1abd2c3ac0..f076b86d922 100644 --- a/docs/virtualizedlist.md +++ b/docs/virtualizedlist.md @@ -123,6 +123,20 @@ Determines how many items are in the data blob. --- +### **`getCellsInItemCount`** + +```jsx +(data: any) => number; +``` + +Determines how many cells are in the data blob + +| Type | +| -------- | +| function | + +--- + ###
Required
**`renderItem`** ```jsx @@ -644,3 +658,26 @@ recordInteraction(); ```jsx setNativeProps((props: Object)); ``` + +## Type Definitions + +### AccessibilityCollectionItem + +Used by TalkBack to announce the position of the item of a collection (row and column numbers). +Information if a node is a collection item. A collection item is contained in a collection, it starts at a given row and column in the collection, and spans one or +more rows and columns. For example, a header of two related table columns starts at the first row and the first column, spans one row and two columns. + +| Type | +| ------ | +| object | + +|
Name
| Type | Description | +| -------------------------------------- | ------ | ------------------------------------------------------------ | +| itemIndex | string | The index of the item in the collection (index of prop.data) | +| rowIndex | string | The row index at which the item is located | +| rowSpan | string | The number of rows the item spans | +| columnIndex | string | The column index at which the item is located | +| columnIndex | string | The column index at which the item is located | +| columnIndex | string | The column index at which the item is located | +| columnSpan | string | The number of columns the item spans | +| heading | string | Whether the item is a heading |