mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "TalkBack support for ScrollView accessibility announcements (list and grid) - Javascript Only Changes"
Summary: Original commit changeset: 3765213c5d8b Original Phabricator Diff: D37189197 (https://github.com/facebook/react-native/commit/2d5882132fb2c533fe9bbba83576b8fac4aca727) Changelog: [Internal] Reviewed By: bvanderhoof Differential Revision: D37260990 fbshipit-source-id: bfcb10f2d5a2a1427b72a10ef380df194b041ba0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
2d5882132f
commit
4bb551d018
@@ -43,7 +43,6 @@ export type AccessibilityRole =
|
||||
| 'tablist'
|
||||
| 'timer'
|
||||
| 'list'
|
||||
| 'grid'
|
||||
| 'toolbar';
|
||||
|
||||
// the info associated with an accessibility action
|
||||
|
||||
@@ -464,23 +464,6 @@ export type ViewProps = $ReadOnly<{|
|
||||
*/
|
||||
accessibilityActions?: ?$ReadOnlyArray<AccessibilityActionInfo>,
|
||||
|
||||
/**
|
||||
*
|
||||
* Node Information of a FlatList, VirtualizedList or SectionList collection item.
|
||||
* A collection item starts at a given row and column in the collection, and spans one or more rows and columns.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
|
||||
@@ -624,17 +624,10 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
||||
return (
|
||||
<View style={StyleSheet.compose(styles.row, columnWrapperStyle)}>
|
||||
{item.map((it, kk) => {
|
||||
const itemIndex = index * cols + kk;
|
||||
const accessibilityCollectionItem = {
|
||||
...info.accessibilityCollectionItem,
|
||||
columnIndex: itemIndex % cols,
|
||||
itemIndex: itemIndex,
|
||||
};
|
||||
const element = renderer({
|
||||
item: it,
|
||||
index: itemIndex,
|
||||
index: index * cols + kk,
|
||||
separators: info.separators,
|
||||
accessibilityCollectionItem,
|
||||
});
|
||||
return element != null ? (
|
||||
<React.Fragment key={kk}>{element}</React.Fragment>
|
||||
@@ -665,7 +658,6 @@ class FlatList<ItemT> extends React.PureComponent<Props<ItemT>, void> {
|
||||
return (
|
||||
<VirtualizedList
|
||||
{...restProps}
|
||||
numColumns={numColumns}
|
||||
getItem={this._getItem}
|
||||
getItemCount={this._getItemCount}
|
||||
keyExtractor={this._keyExtractor}
|
||||
|
||||
@@ -35,7 +35,6 @@ const ScrollView = require('../Components/ScrollView/ScrollView');
|
||||
const View = require('../Components/View/View');
|
||||
const Batchinator = require('../Interaction/Batchinator');
|
||||
const ReactNative = require('../Renderer/shims/ReactNative');
|
||||
const Platform = require('../Utilities/Platform');
|
||||
const flattenStyle = require('../StyleSheet/flattenStyle');
|
||||
const StyleSheet = require('../StyleSheet/StyleSheet');
|
||||
const infoLog = require('../Utilities/infoLog');
|
||||
@@ -54,20 +53,10 @@ export type Separators = {
|
||||
...
|
||||
};
|
||||
|
||||
export type AccessibilityCollectionItem = {
|
||||
itemIndex: number,
|
||||
rowIndex: number,
|
||||
rowSpan: number,
|
||||
columnIndex: number,
|
||||
columnSpan: number,
|
||||
heading: boolean,
|
||||
};
|
||||
|
||||
export type RenderItemProps<ItemT> = {
|
||||
item: ItemT,
|
||||
index: number,
|
||||
separators: Separators,
|
||||
accessibilityCollectionItem: AccessibilityCollectionItem,
|
||||
...
|
||||
};
|
||||
|
||||
@@ -96,19 +85,9 @@ type RequiredProps = {|
|
||||
*/
|
||||
getItem: (data: any, index: number) => ?Item,
|
||||
/**
|
||||
* Determines how many items (rows) are in the data blob.
|
||||
* Determines how many items are in the data blob.
|
||||
*/
|
||||
getItemCount: (data: any) => number,
|
||||
/**
|
||||
* Determines how many cells are in the data blob
|
||||
* see https://bit.ly/35RKX7H
|
||||
*/
|
||||
getCellsInItemCount?: (data: any) => number,
|
||||
/**
|
||||
* The number of columns used in FlatList.
|
||||
* The default of 1 is used in other components to calculate the accessibilityCollection prop.
|
||||
*/
|
||||
numColumns?: ?number,
|
||||
|};
|
||||
type OptionalProps = {|
|
||||
renderItem?: ?RenderItemType<Item>,
|
||||
@@ -329,10 +308,6 @@ type Props = {|
|
||||
...OptionalProps,
|
||||
|};
|
||||
|
||||
function numColumnsOrDefault(numColumns: ?number) {
|
||||
return numColumns ?? 1;
|
||||
}
|
||||
|
||||
let _usedIndexForKey = false;
|
||||
let _keylessItemComponentName: string = '';
|
||||
|
||||
@@ -1278,33 +1253,8 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
);
|
||||
}
|
||||
|
||||
_getCellsInItemCount = props => {
|
||||
const {getCellsInItemCount, data} = props;
|
||||
if (getCellsInItemCount) {
|
||||
return getCellsInItemCount(data);
|
||||
}
|
||||
if (Array.isArray(data)) {
|
||||
return data.length;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
_defaultRenderScrollComponent = props => {
|
||||
const {getItemCount, data} = props;
|
||||
const onRefresh = props.onRefresh;
|
||||
const numColumns = numColumnsOrDefault(props.numColumns);
|
||||
const accessibilityRole = Platform.select({
|
||||
android: numColumns > 1 ? 'grid' : 'list',
|
||||
});
|
||||
const rowCount = getItemCount(data);
|
||||
const accessibilityCollection = {
|
||||
// over-ride _getCellsInItemCount to handle Objects or other data formats
|
||||
// see https://bit.ly/35RKX7H
|
||||
itemCount: this._getCellsInItemCount(props),
|
||||
rowCount,
|
||||
columnCount: numColumns,
|
||||
hierarchical: false,
|
||||
};
|
||||
if (this._isNestedWithSameOrientation()) {
|
||||
// $FlowFixMe[prop-missing] - Typing ReactNativeComponent revealed errors
|
||||
return <View {...props} />;
|
||||
@@ -1319,8 +1269,6 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
// $FlowFixMe[prop-missing] Invalid prop usage
|
||||
<ScrollView
|
||||
{...props}
|
||||
accessibilityRole={accessibilityRole}
|
||||
accessibilityCollection={accessibilityCollection}
|
||||
refreshControl={
|
||||
props.refreshControl == null ? (
|
||||
<RefreshControl
|
||||
@@ -1336,14 +1284,8 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
// $FlowFixMe[prop-missing] Invalid prop usage
|
||||
<ScrollView
|
||||
{...props}
|
||||
accessibilityRole={accessibilityRole}
|
||||
accessibilityCollection={accessibilityCollection}
|
||||
/>
|
||||
);
|
||||
// $FlowFixMe[prop-missing] Invalid prop usage
|
||||
return <ScrollView {...props} />;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2114,19 +2056,10 @@ class CellRenderer extends React.Component<
|
||||
}
|
||||
|
||||
if (renderItem) {
|
||||
const accessibilityCollectionItem = {
|
||||
itemIndex: index,
|
||||
rowIndex: index,
|
||||
rowSpan: 1,
|
||||
columnIndex: 0,
|
||||
columnSpan: 1,
|
||||
heading: false,
|
||||
};
|
||||
return renderItem({
|
||||
item,
|
||||
index,
|
||||
separators: this._separators,
|
||||
accessibilityCollectionItem,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import type {ViewToken} from './ViewabilityHelper';
|
||||
import type {AccessibilityCollectionItem} from './VirtualizedList';
|
||||
|
||||
import {keyExtractor as defaultKeyExtractor} from './VirtualizeUtils';
|
||||
import invariant from 'invariant';
|
||||
import * as React from 'react';
|
||||
@@ -341,16 +341,7 @@ class VirtualizedSectionList<
|
||||
_renderItem =
|
||||
(listItemCount: number) =>
|
||||
// eslint-disable-next-line react/no-unstable-nested-components
|
||||
({
|
||||
item,
|
||||
index,
|
||||
accessibilityCollectionItem,
|
||||
}: {
|
||||
item: Item,
|
||||
index: number,
|
||||
accessibilityCollectionItem: AccessibilityCollectionItem,
|
||||
...
|
||||
}) => {
|
||||
({item, index}: {item: Item, index: number, ...}) => {
|
||||
const info = this._subExtractor(index);
|
||||
if (!info) {
|
||||
return null;
|
||||
@@ -379,7 +370,6 @@ class VirtualizedSectionList<
|
||||
LeadingSeparatorComponent={
|
||||
infoIndex === 0 ? this.props.SectionSeparatorComponent : undefined
|
||||
}
|
||||
accessibilityCollectionItem={accessibilityCollectionItem}
|
||||
cellKey={info.key}
|
||||
index={infoIndex}
|
||||
item={item}
|
||||
@@ -492,7 +482,6 @@ type ItemWithSeparatorProps = $ReadOnly<{|
|
||||
updatePropsFor: (prevCellKey: string, value: Object) => void,
|
||||
renderItem: Function,
|
||||
inverted: boolean,
|
||||
accessibilityCollectionItem: AccessibilityCollectionItem,
|
||||
|}>;
|
||||
|
||||
function ItemWithSeparator(props: ItemWithSeparatorProps): React.Node {
|
||||
@@ -510,7 +499,6 @@ function ItemWithSeparator(props: ItemWithSeparatorProps): React.Node {
|
||||
index,
|
||||
section,
|
||||
inverted,
|
||||
accessibilityCollectionItem,
|
||||
} = props;
|
||||
|
||||
const [leadingSeparatorHiglighted, setLeadingSeparatorHighlighted] =
|
||||
@@ -584,7 +572,6 @@ function ItemWithSeparator(props: ItemWithSeparatorProps): React.Node {
|
||||
index,
|
||||
section,
|
||||
separators,
|
||||
accessibilityCollectionItem,
|
||||
});
|
||||
const leadingSeparator = LeadingSeparatorComponent != null && (
|
||||
<LeadingSeparatorComponent
|
||||
|
||||
@@ -6,14 +6,6 @@ exports[`FlatList renders all the bells and whistles 1`] = `
|
||||
ListEmptyComponent={[Function]}
|
||||
ListFooterComponent={[Function]}
|
||||
ListHeaderComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 2,
|
||||
"hierarchical": false,
|
||||
"itemCount": 5,
|
||||
"rowCount": 3,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -37,7 +29,6 @@ exports[`FlatList renders all the bells and whistles 1`] = `
|
||||
getItemCount={[Function]}
|
||||
getItemLayout={[Function]}
|
||||
keyExtractor={[Function]}
|
||||
numColumns={2}
|
||||
onContentSizeChange={[Function]}
|
||||
onLayout={[Function]}
|
||||
onMomentumScrollBegin={[Function]}
|
||||
@@ -130,14 +121,6 @@ exports[`FlatList renders all the bells and whistles 1`] = `
|
||||
|
||||
exports[`FlatList renders empty list 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 0,
|
||||
}
|
||||
}
|
||||
data={Array []}
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
@@ -161,14 +144,6 @@ exports[`FlatList renders empty list 1`] = `
|
||||
|
||||
exports[`FlatList renders null list 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 0,
|
||||
}
|
||||
}
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
keyExtractor={[Function]}
|
||||
@@ -191,14 +166,6 @@ exports[`FlatList renders null list 1`] = `
|
||||
|
||||
exports[`FlatList renders simple list (multiple columns) 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 2,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 2,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -215,7 +182,6 @@ exports[`FlatList renders simple list (multiple columns) 1`] = `
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
keyExtractor={[Function]}
|
||||
numColumns={2}
|
||||
onContentSizeChange={[Function]}
|
||||
onLayout={[Function]}
|
||||
onMomentumScrollBegin={[Function]}
|
||||
@@ -271,14 +237,6 @@ exports[`FlatList renders simple list (multiple columns) 1`] = `
|
||||
|
||||
exports[`FlatList renders simple list 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 3,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -340,14 +298,6 @@ exports[`FlatList renders simple list 1`] = `
|
||||
exports[`FlatList renders simple list using ListItemComponent (multiple columns) 1`] = `
|
||||
<RCTScrollView
|
||||
ListItemComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 2,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 2,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -364,7 +314,6 @@ exports[`FlatList renders simple list using ListItemComponent (multiple columns)
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
keyExtractor={[Function]}
|
||||
numColumns={2}
|
||||
onContentSizeChange={[Function]}
|
||||
onLayout={[Function]}
|
||||
onMomentumScrollBegin={[Function]}
|
||||
@@ -420,14 +369,6 @@ exports[`FlatList renders simple list using ListItemComponent (multiple columns)
|
||||
exports[`FlatList renders simple list using ListItemComponent 1`] = `
|
||||
<RCTScrollView
|
||||
ListItemComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 3,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
|
||||
@@ -2,14 +2,6 @@
|
||||
|
||||
exports[`SectionList rendering empty section headers is fine 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 4,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -74,14 +66,6 @@ exports[`SectionList rendering empty section headers is fine 1`] = `
|
||||
|
||||
exports[`SectionList renders a footer when there is no data 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 2,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -131,14 +115,6 @@ exports[`SectionList renders a footer when there is no data 1`] = `
|
||||
|
||||
exports[`SectionList renders a footer when there is no data and no header 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 2,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -187,14 +163,6 @@ exports[`SectionList renders all the bells and whistles 1`] = `
|
||||
ListEmptyComponent={[Function]}
|
||||
ListFooterComponent={[Function]}
|
||||
ListHeaderComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 12,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -290,7 +258,7 @@ exports[`SectionList renders all the bells and whistles 1`] = `
|
||||
v="highlighted:false,leadingItem:undefined,leadingSection:undefined,section:s1,trailingItem:i1s1,trailingSection:s2"
|
||||
/>
|
||||
<itemForSection1
|
||||
v="item:i1s1,index:0,section:s1,separators:[object Object],accessibilityCollectionItem:[object Object]"
|
||||
v="item:i1s1,index:0,section:s1,separators:[object Object]"
|
||||
/>
|
||||
<itemSeparatorForSection1
|
||||
v="highlighted:false,leadingItem:i1s1,leadingSection:undefined,section:s1,trailingItem:i2s1,trailingSection:s2"
|
||||
@@ -303,7 +271,7 @@ exports[`SectionList renders all the bells and whistles 1`] = `
|
||||
>
|
||||
<View>
|
||||
<itemForSection1
|
||||
v="item:i2s1,index:1,section:s1,separators:[object Object],accessibilityCollectionItem:[object Object]"
|
||||
v="item:i2s1,index:1,section:s1,separators:[object Object]"
|
||||
/>
|
||||
<sectionSeparator
|
||||
v="highlighted:false,leadingItem:i2s1,leadingSection:undefined,section:s1,trailingItem:undefined,trailingSection:s2"
|
||||
@@ -335,7 +303,7 @@ exports[`SectionList renders all the bells and whistles 1`] = `
|
||||
v="highlighted:false,leadingItem:undefined,leadingSection:s1,section:s2,trailingItem:i1s2,trailingSection:s3"
|
||||
/>
|
||||
<defaultItem
|
||||
v="item:i1s2,index:0,section:s2,separators:[object Object],accessibilityCollectionItem:[object Object]"
|
||||
v="item:i1s2,index:0,section:s2,separators:[object Object]"
|
||||
/>
|
||||
<defaultItemSeparator
|
||||
v="highlighted:false,leadingItem:i1s2,leadingSection:s1,section:s2,trailingItem:i2s2,trailingSection:s3"
|
||||
@@ -348,7 +316,7 @@ exports[`SectionList renders all the bells and whistles 1`] = `
|
||||
>
|
||||
<View>
|
||||
<defaultItem
|
||||
v="item:i2s2,index:1,section:s2,separators:[object Object],accessibilityCollectionItem:[object Object]"
|
||||
v="item:i2s2,index:1,section:s2,separators:[object Object]"
|
||||
/>
|
||||
<sectionSeparator
|
||||
v="highlighted:false,leadingItem:i2s2,leadingSection:s1,section:s2,trailingItem:undefined,trailingSection:s3"
|
||||
@@ -380,7 +348,7 @@ exports[`SectionList renders all the bells and whistles 1`] = `
|
||||
v="highlighted:false,leadingItem:undefined,leadingSection:s2,section:s3,trailingItem:i1s3,trailingSection:undefined"
|
||||
/>
|
||||
<defaultItem
|
||||
v="item:i1s3,index:0,section:s3,separators:[object Object],accessibilityCollectionItem:[object Object]"
|
||||
v="item:i1s3,index:0,section:s3,separators:[object Object]"
|
||||
/>
|
||||
<defaultItemSeparator
|
||||
v="highlighted:false,leadingItem:i1s3,leadingSection:s2,section:s3,trailingItem:i2s3,trailingSection:undefined"
|
||||
@@ -393,7 +361,7 @@ exports[`SectionList renders all the bells and whistles 1`] = `
|
||||
>
|
||||
<View>
|
||||
<defaultItem
|
||||
v="item:i2s3,index:1,section:s3,separators:[object Object],accessibilityCollectionItem:[object Object]"
|
||||
v="item:i2s3,index:1,section:s3,separators:[object Object]"
|
||||
/>
|
||||
<sectionSeparator
|
||||
v="highlighted:false,leadingItem:i2s3,leadingSection:s2,section:s3,trailingItem:undefined,trailingSection:undefined"
|
||||
@@ -421,14 +389,6 @@ exports[`SectionList renders all the bells and whistles 1`] = `
|
||||
|
||||
exports[`SectionList renders empty list 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 0,
|
||||
}
|
||||
}
|
||||
data={Array []}
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
|
||||
@@ -3,14 +3,6 @@
|
||||
exports[`VirtualizedList forwards correct stickyHeaderIndices when ListHeaderComponent present 1`] = `
|
||||
<RCTScrollView
|
||||
ListHeaderComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -157,14 +149,6 @@ exports[`VirtualizedList forwards correct stickyHeaderIndices when ListHeaderCom
|
||||
|
||||
exports[`VirtualizedList forwards correct stickyHeaderIndices when all in initial render window 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -306,14 +290,6 @@ exports[`VirtualizedList forwards correct stickyHeaderIndices when all in initia
|
||||
|
||||
exports[`VirtualizedList forwards correct stickyHeaderIndices when partially in initial render window 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -423,14 +399,6 @@ exports[`VirtualizedList forwards correct stickyHeaderIndices when partially in
|
||||
|
||||
exports[`VirtualizedList handles nested lists 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 2,
|
||||
"rowCount": 2,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -507,14 +475,6 @@ exports[`VirtualizedList handles nested lists 1`] = `
|
||||
style={null}
|
||||
>
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 2,
|
||||
"rowCount": 2,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -580,14 +540,6 @@ exports[`VirtualizedList handles nested lists 1`] = `
|
||||
exports[`VirtualizedList handles separators correctly 1`] = `
|
||||
<RCTScrollView
|
||||
ItemSeparatorComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 3,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -662,14 +614,6 @@ exports[`VirtualizedList handles separators correctly 1`] = `
|
||||
exports[`VirtualizedList handles separators correctly 2`] = `
|
||||
<RCTScrollView
|
||||
ItemSeparatorComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 3,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -744,14 +688,6 @@ exports[`VirtualizedList handles separators correctly 2`] = `
|
||||
exports[`VirtualizedList handles separators correctly 3`] = `
|
||||
<RCTScrollView
|
||||
ItemSeparatorComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 3,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -826,14 +762,6 @@ exports[`VirtualizedList handles separators correctly 3`] = `
|
||||
|
||||
exports[`VirtualizedList keeps sticky headers above viewport visualized 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 20,
|
||||
"rowCount": 20,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1052,14 +980,6 @@ exports[`VirtualizedList renders all the bells and whistles 1`] = `
|
||||
ListEmptyComponent={[Function]}
|
||||
ListFooterComponent={[Function]}
|
||||
ListHeaderComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 5,
|
||||
"rowCount": 5,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1256,14 +1176,6 @@ exports[`VirtualizedList renders all the bells and whistles 1`] = `
|
||||
|
||||
exports[`VirtualizedList renders empty list 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 0,
|
||||
}
|
||||
}
|
||||
data={Array []}
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
@@ -1284,14 +1196,6 @@ exports[`VirtualizedList renders empty list 1`] = `
|
||||
|
||||
exports[`VirtualizedList renders empty list after batch 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 0,
|
||||
}
|
||||
}
|
||||
data={Array []}
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
@@ -1315,14 +1219,6 @@ exports[`VirtualizedList renders empty list with empty component 1`] = `
|
||||
ListEmptyComponent={[Function]}
|
||||
ListFooterComponent={[Function]}
|
||||
ListHeaderComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 0,
|
||||
}
|
||||
}
|
||||
data={Array []}
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
@@ -1356,14 +1252,6 @@ exports[`VirtualizedList renders empty list with empty component 1`] = `
|
||||
exports[`VirtualizedList renders list with empty component 1`] = `
|
||||
<RCTScrollView
|
||||
ListEmptyComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 1,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1399,14 +1287,6 @@ exports[`VirtualizedList renders list with empty component 1`] = `
|
||||
|
||||
exports[`VirtualizedList renders null list 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 0,
|
||||
}
|
||||
}
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
onContentSizeChange={[Function]}
|
||||
@@ -1426,14 +1306,6 @@ exports[`VirtualizedList renders null list 1`] = `
|
||||
|
||||
exports[`VirtualizedList renders simple list 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 3,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1492,14 +1364,6 @@ exports[`VirtualizedList renders simple list 1`] = `
|
||||
exports[`VirtualizedList renders simple list using ListItemComponent 1`] = `
|
||||
<RCTScrollView
|
||||
ListItemComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 3,
|
||||
"rowCount": 3,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1556,14 +1420,6 @@ exports[`VirtualizedList renders simple list using ListItemComponent 1`] = `
|
||||
|
||||
exports[`VirtualizedList renders sticky headers in viewport on batched render 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1674,14 +1530,6 @@ exports[`VirtualizedList renders sticky headers in viewport on batched render 1`
|
||||
|
||||
exports[`VirtualizedList test getItem functionality where data is not an Array 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 1,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Map {
|
||||
"id_0" => Object {
|
||||
@@ -1718,14 +1566,6 @@ exports[`VirtualizedList test getItem functionality where data is not an Array 1
|
||||
exports[`VirtualizedList warns if both renderItem or ListItemComponent are specified. Uses ListItemComponent 1`] = `
|
||||
<RCTScrollView
|
||||
ListItemComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 1,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1762,14 +1602,6 @@ exports[`VirtualizedList warns if both renderItem or ListItemComponent are speci
|
||||
|
||||
exports[`adjusts render area with non-zero initialScrollIndex 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 20,
|
||||
"rowCount": 20,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1999,14 +1831,6 @@ exports[`adjusts render area with non-zero initialScrollIndex 1`] = `
|
||||
|
||||
exports[`constrains batch render region when an item is removed 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 5,
|
||||
"rowCount": 5,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -2084,14 +1908,6 @@ exports[`constrains batch render region when an item is removed 1`] = `
|
||||
|
||||
exports[`discards intitial render if initialScrollIndex != 0 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 20,
|
||||
"rowCount": 20,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -2264,14 +2080,6 @@ exports[`discards intitial render if initialScrollIndex != 0 1`] = `
|
||||
|
||||
exports[`does not adjust render area until content area layed out 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 20,
|
||||
"rowCount": 20,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -2401,14 +2209,6 @@ exports[`does not adjust render area until content area layed out 1`] = `
|
||||
|
||||
exports[`does not over-render when there is less than initialNumToRender cells 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -2536,14 +2336,6 @@ exports[`does not over-render when there is less than initialNumToRender cells 1
|
||||
|
||||
exports[`eventually renders all items when virtualization disabled 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -2674,14 +2466,6 @@ exports[`eventually renders all items when virtualization disabled 1`] = `
|
||||
|
||||
exports[`expands first in viewport to render up to maxToRenderPerBatch on initial render 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -2789,14 +2573,6 @@ exports[`expands first in viewport to render up to maxToRenderPerBatch on initia
|
||||
|
||||
exports[`expands render area by maxToRenderPerBatch on tick 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 20,
|
||||
"rowCount": 20,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -2940,14 +2716,6 @@ exports[`expands render area by maxToRenderPerBatch on tick 1`] = `
|
||||
|
||||
exports[`renders a zero-height tail spacer on initial render if getItemLayout not defined 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3034,14 +2802,6 @@ exports[`renders a zero-height tail spacer on initial render if getItemLayout no
|
||||
|
||||
exports[`renders full tail spacer if all cells measured 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3146,14 +2906,6 @@ exports[`renders full tail spacer if all cells measured 1`] = `
|
||||
|
||||
exports[`renders initialNumToRender cells when virtualization disabled 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3254,14 +3006,6 @@ exports[`renders initialNumToRender cells when virtualization disabled 1`] = `
|
||||
|
||||
exports[`renders items before initialScrollIndex on first batch tick when virtualization disabled 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3370,14 +3114,6 @@ exports[`renders items before initialScrollIndex on first batch tick when virtua
|
||||
|
||||
exports[`renders new items when data is updated with non-zero initialScrollIndex 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 4,
|
||||
"rowCount": 4,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3447,14 +3183,6 @@ exports[`renders new items when data is updated with non-zero initialScrollIndex
|
||||
|
||||
exports[`renders no spacers up to initialScrollIndex on first render when virtualization disabled 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3528,14 +3256,6 @@ exports[`renders no spacers up to initialScrollIndex on first render when virtua
|
||||
|
||||
exports[`renders offset cells in initial render when initialScrollIndex set 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3656,14 +3376,6 @@ exports[`renders offset cells in initial render when initialScrollIndex set 1`]
|
||||
|
||||
exports[`renders tail spacer up to last measured index if getItemLayout not defined 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3768,14 +3480,6 @@ exports[`renders tail spacer up to last measured index if getItemLayout not defi
|
||||
|
||||
exports[`renders tail spacer up to last measured with irregular layout when getItemLayout undefined 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3872,14 +3576,6 @@ exports[`renders tail spacer up to last measured with irregular layout when getI
|
||||
|
||||
exports[`renders windowSize derived region at bottom 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -3987,14 +3683,6 @@ exports[`renders windowSize derived region at bottom 1`] = `
|
||||
|
||||
exports[`renders windowSize derived region at top 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -4088,14 +3776,6 @@ exports[`renders windowSize derived region at top 1`] = `
|
||||
|
||||
exports[`renders windowSize derived region in middle 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -4224,14 +3904,6 @@ exports[`renders windowSize derived region in middle 1`] = `
|
||||
|
||||
exports[`renders zero-height tail spacer on batch render if cells not yet measured and getItemLayout not defined 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 10,
|
||||
"rowCount": 10,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -4320,14 +3992,6 @@ exports[`renders zero-height tail spacer on batch render if cells not yet measur
|
||||
|
||||
exports[`retains batch render region when an item is appended 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 11,
|
||||
"rowCount": 11,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -4465,14 +4129,6 @@ exports[`retains batch render region when an item is appended 1`] = `
|
||||
|
||||
exports[`retains initial render region when an item is appended 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 11,
|
||||
"rowCount": 11,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -4560,14 +4216,6 @@ exports[`retains initial render region when an item is appended 1`] = `
|
||||
|
||||
exports[`retains intitial render if initialScrollIndex == 0 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 20,
|
||||
"rowCount": 20,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -4775,14 +4423,6 @@ exports[`retains intitial render if initialScrollIndex == 0 1`] = `
|
||||
|
||||
exports[`unmounts sticky headers moved below viewport 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 20,
|
||||
"rowCount": 20,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
|
||||
@@ -2,14 +2,6 @@
|
||||
|
||||
exports[`VirtualizedSectionList handles nested lists 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 4,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -110,14 +102,6 @@ exports[`VirtualizedSectionList handles nested lists 1`] = `
|
||||
style={null}
|
||||
>
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 4,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -214,14 +198,6 @@ exports[`VirtualizedSectionList handles nested lists 1`] = `
|
||||
|
||||
exports[`VirtualizedSectionList handles separators correctly 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 5,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -355,14 +331,6 @@ exports[`VirtualizedSectionList handles separators correctly 1`] = `
|
||||
|
||||
exports[`VirtualizedSectionList handles separators correctly 2`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 5,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -496,14 +464,6 @@ exports[`VirtualizedSectionList handles separators correctly 2`] = `
|
||||
|
||||
exports[`VirtualizedSectionList handles separators correctly 3`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 5,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -638,14 +598,6 @@ exports[`VirtualizedSectionList handles separators correctly 3`] = `
|
||||
|
||||
exports[`VirtualizedSectionList handles separators correctly 4`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 5,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -783,14 +735,6 @@ exports[`VirtualizedSectionList renders all the bells and whistles 1`] = `
|
||||
ListEmptyComponent={[Function]}
|
||||
ListFooterComponent={[Function]}
|
||||
ListHeaderComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 7,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1032,14 +976,6 @@ exports[`VirtualizedSectionList renders all the bells and whistles 1`] = `
|
||||
|
||||
exports[`VirtualizedSectionList renders empty list 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 0,
|
||||
}
|
||||
}
|
||||
data={Array []}
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
@@ -1064,14 +1000,6 @@ exports[`VirtualizedSectionList renders empty list with empty component 1`] = `
|
||||
ListEmptyComponent={[Function]}
|
||||
ListFooterComponent={[Function]}
|
||||
ListHeaderComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 0,
|
||||
"rowCount": 0,
|
||||
}
|
||||
}
|
||||
data={Array []}
|
||||
getItem={[Function]}
|
||||
getItemCount={[Function]}
|
||||
@@ -1106,14 +1034,6 @@ exports[`VirtualizedSectionList renders empty list with empty component 1`] = `
|
||||
exports[`VirtualizedSectionList renders list with empty component 1`] = `
|
||||
<RCTScrollView
|
||||
ListEmptyComponent={[Function]}
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 3,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -1163,14 +1083,6 @@ exports[`VirtualizedSectionList renders list with empty component 1`] = `
|
||||
|
||||
exports[`VirtualizedSectionList renders simple list 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 1,
|
||||
"rowCount": 5,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
|
||||
@@ -297,21 +297,17 @@ class FlatListExample extends React.PureComponent<Props, State> {
|
||||
/* $FlowFixMe[invalid-computed-prop] (>=0.111.0 site=react_native_fb)
|
||||
* This comment suppresses an error found when Flow v0.111 was deployed.
|
||||
* To see the error, delete this comment and run Flow. */
|
||||
[flatListPropKey]: ({item, separators, accessibilityCollectionItem}) => {
|
||||
[flatListPropKey]: ({item, separators}) => {
|
||||
return (
|
||||
<View
|
||||
importantForAccessibility="yes"
|
||||
accessibilityCollectionItem={accessibilityCollectionItem}>
|
||||
<ItemComponent
|
||||
item={item}
|
||||
horizontal={this.state.horizontal}
|
||||
fixedHeight={this.state.fixedHeight}
|
||||
onPress={this._onPressCallback()}
|
||||
onShowUnderlay={separators.highlight}
|
||||
onHideUnderlay={separators.unhighlight}
|
||||
textSelectable={this.state.textSelectable}
|
||||
/>
|
||||
</View>
|
||||
<ItemComponent
|
||||
item={item}
|
||||
horizontal={this.state.horizontal}
|
||||
fixedHeight={this.state.fixedHeight}
|
||||
onPress={this._onPressCallback()}
|
||||
onShowUnderlay={separators.highlight}
|
||||
onHideUnderlay={separators.unhighlight}
|
||||
textSelectable={this.state.textSelectable}
|
||||
/>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -140,12 +140,9 @@ class MultiColumnExample extends React.PureComponent<
|
||||
getItemLayout(data, index).length + 2 * (CARD_MARGIN + BORDER_WIDTH);
|
||||
return {length, offset: length * index, index};
|
||||
}
|
||||
_renderItemComponent = ({item, accessibilityCollectionItem}) => {
|
||||
_renderItemComponent = ({item}: RenderItemProps<any | Item>) => {
|
||||
return (
|
||||
<View
|
||||
importantForAccessibility="yes"
|
||||
accessibilityCollectionItem={accessibilityCollectionItem}
|
||||
style={styles.card}>
|
||||
<View style={styles.card}>
|
||||
<ItemComponent
|
||||
item={item}
|
||||
fixedHeight={this.state.fixedHeight}
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
* @flow
|
||||
*/
|
||||
|
||||
import * as React from 'react';
|
||||
import {
|
||||
SafeAreaView,
|
||||
View,
|
||||
FlatList,
|
||||
StyleSheet,
|
||||
Text,
|
||||
StatusBar,
|
||||
} from 'react-native';
|
||||
|
||||
const DATA = [
|
||||
{
|
||||
id: 'bd7acbea-c1b1-46c2-aed5-3ad53abb28ba',
|
||||
title: 'First Item',
|
||||
},
|
||||
{
|
||||
id: '3ac68afc-c605-48d3-a4f8-fbd91aa97f63',
|
||||
title: 'Second Item',
|
||||
},
|
||||
{
|
||||
id: '58694a0f-3da1-471f-bd96-145571e29d72',
|
||||
title: 'Third Item',
|
||||
},
|
||||
{
|
||||
id: 'bd7acbea-c1b1-46c2-aed5-3ad53abb8bbb',
|
||||
title: 'Fourth Item',
|
||||
},
|
||||
{
|
||||
id: '3ac68afc-c605-48d3-a4f8-fbd91aa97676',
|
||||
title: 'Fifth Item',
|
||||
},
|
||||
{
|
||||
id: '58694a0f-3da1-471f-bd96-145571e27234',
|
||||
title: 'Sixth Item',
|
||||
},
|
||||
{
|
||||
id: '58694a0f-3da1-471f-bd96-145571e29234',
|
||||
title: 'Seven Item',
|
||||
},
|
||||
{
|
||||
id: '58694a0f-3da1-471f-bd96-145571429234',
|
||||
title: 'Eight Item',
|
||||
},
|
||||
{
|
||||
id: '58694a0f-3da1-471f-bd96-115571429234',
|
||||
title: 'Nine Item',
|
||||
},
|
||||
{
|
||||
id: '58694a0f-3da1-471f-bd96-1155h1429234',
|
||||
title: 'Ten Item',
|
||||
},
|
||||
];
|
||||
|
||||
const Item = ({item, accessibilityCollectionItem}) => (
|
||||
<View
|
||||
importantForAccessibility="yes"
|
||||
accessibilityCollectionItem={accessibilityCollectionItem}
|
||||
style={styles.item}>
|
||||
<Text style={styles.title}>{item.title}</Text>
|
||||
</View>
|
||||
);
|
||||
|
||||
const renderItem = props => <Item {...props} />;
|
||||
|
||||
const renderFlatList = ({item}) => {
|
||||
return (
|
||||
<View>
|
||||
<Text>Flatlist {item}</Text>
|
||||
<FlatList renderItem={renderItem} horizontal data={DATA} />
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
const FlatListNested = (): React.Node => {
|
||||
return (
|
||||
<SafeAreaView style={styles.container}>
|
||||
<FlatList
|
||||
data={[1, 2, 3]}
|
||||
renderItem={renderFlatList}
|
||||
keyExtractor={item => item.toString()}
|
||||
/>
|
||||
</SafeAreaView>
|
||||
);
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
marginTop: StatusBar.currentHeight || 0,
|
||||
},
|
||||
item: {
|
||||
backgroundColor: '#f9c2ff',
|
||||
padding: 20,
|
||||
marginVertical: 8,
|
||||
marginHorizontal: 16,
|
||||
},
|
||||
title: {
|
||||
fontSize: 16,
|
||||
},
|
||||
});
|
||||
|
||||
exports.title = 'FlatList Nested';
|
||||
exports.testTitle = 'Test accessibility announcement in nested flatlist';
|
||||
exports.category = 'ListView';
|
||||
exports.documentationURL = 'https://reactnative.dev/docs/flatlist';
|
||||
exports.description = 'Nested flatlist example';
|
||||
exports.examples = [
|
||||
{
|
||||
title: 'FlatList Nested example',
|
||||
render: function (): React.Element<typeof FlatListNested> {
|
||||
return <FlatListNested />;
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -109,7 +109,7 @@ const EmptySectionList = () => (
|
||||
|
||||
const renderItemComponent =
|
||||
setItemState =>
|
||||
({item, separators, accessibilityCollectionItem}) => {
|
||||
({item, separators}) => {
|
||||
if (isNaN(item.key)) {
|
||||
return;
|
||||
}
|
||||
@@ -119,16 +119,12 @@ const renderItemComponent =
|
||||
};
|
||||
|
||||
return (
|
||||
<View
|
||||
importantForAccessibility="yes"
|
||||
accessibilityCollectionItem={accessibilityCollectionItem}>
|
||||
<ItemComponent
|
||||
item={item}
|
||||
onPress={onPress}
|
||||
onHideUnderlay={separators.unhighlight}
|
||||
onShowUnderlay={separators.highlight}
|
||||
/>
|
||||
</View>
|
||||
<ItemComponent
|
||||
item={item}
|
||||
onPress={onPress}
|
||||
onHideUnderlay={separators.unhighlight}
|
||||
onShowUnderlay={separators.highlight}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -31,11 +31,6 @@ const Components: Array<RNTesterModuleInfo> = [
|
||||
category: 'ListView',
|
||||
supportsTVOS: true,
|
||||
},
|
||||
{
|
||||
key: 'FlatList-nested',
|
||||
module: require('../examples/FlatList/FlatList-nested'),
|
||||
category: 'ListView',
|
||||
},
|
||||
{
|
||||
key: 'ImageExample',
|
||||
category: 'Basic',
|
||||
|
||||
Reference in New Issue
Block a user