mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Revert D34518929: TalkBack support for ScrollView accessibility announcements (list and grid)
Differential Revision: D34518929 (https://github.com/facebook/react-native/commit/dd6325bafe1a539d348f3710e717a6344576b859) Original commit changeset: 410a05263a56 Original Phabricator Diff: D34518929 (https://github.com/facebook/react-native/commit/dd6325bafe1a539d348f3710e717a6344576b859) fbshipit-source-id: 114d0910970c5f5caefb98c378722faba283f2a1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cf55fd587e
commit
a12959546a
@@ -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}
|
||||
|
||||
@@ -12,7 +12,6 @@ const Batchinator = require('../Interaction/Batchinator');
|
||||
const FillRateHelper = require('./FillRateHelper');
|
||||
const ReactNative = require('../Renderer/shims/ReactNative');
|
||||
const RefreshControl = require('../Components/RefreshControl/RefreshControl');
|
||||
const Platform = require('../Utilities/Platform');
|
||||
const ScrollView = require('../Components/ScrollView/ScrollView');
|
||||
const StyleSheet = require('../StyleSheet/StyleSheet');
|
||||
const View = require('../Components/View/View');
|
||||
@@ -53,20 +52,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,
|
||||
...
|
||||
};
|
||||
|
||||
@@ -95,19 +84,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>,
|
||||
@@ -327,10 +306,6 @@ type Props = {|
|
||||
...OptionalProps,
|
||||
|};
|
||||
|
||||
function numColumnsOrDefault(numColumns: ?number) {
|
||||
return numColumns ?? 1;
|
||||
}
|
||||
|
||||
let _usedIndexForKey = false;
|
||||
let _keylessItemComponentName: string = '';
|
||||
|
||||
@@ -1267,33 +1242,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} />;
|
||||
@@ -1308,8 +1258,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
|
||||
@@ -1324,14 +1272,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} />;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2076,19 +2018,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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
import invariant from 'invariant';
|
||||
import type {ViewToken} from './ViewabilityHelper';
|
||||
import type {AccessibilityCollectionItem} from './VirtualizedList';
|
||||
import {keyExtractor as defaultKeyExtractor} from './VirtualizeUtils';
|
||||
import {View, VirtualizedList} from 'react-native';
|
||||
import * as React from 'react';
|
||||
@@ -339,16 +338,7 @@ class VirtualizedSectionList<
|
||||
|
||||
_renderItem =
|
||||
(listItemCount: number) =>
|
||||
({
|
||||
item,
|
||||
index,
|
||||
accessibilityCollectionItem,
|
||||
}: {
|
||||
item: Item,
|
||||
index: number,
|
||||
accessibilityCollectionItem: AccessibilityCollectionItem,
|
||||
...
|
||||
}) => {
|
||||
({item, index}: {item: Item, index: number, ...}) => {
|
||||
const info = this._subExtractor(index);
|
||||
if (!info) {
|
||||
return null;
|
||||
@@ -377,7 +367,6 @@ class VirtualizedSectionList<
|
||||
LeadingSeparatorComponent={
|
||||
infoIndex === 0 ? this.props.SectionSeparatorComponent : undefined
|
||||
}
|
||||
accessibilityCollectionItem={accessibilityCollectionItem}
|
||||
cellKey={info.key}
|
||||
index={infoIndex}
|
||||
item={item}
|
||||
@@ -490,7 +479,6 @@ type ItemWithSeparatorProps = $ReadOnly<{|
|
||||
updatePropsFor: (prevCellKey: string, value: Object) => void,
|
||||
renderItem: Function,
|
||||
inverted: boolean,
|
||||
accessibilityCollectionItem: AccessibilityCollectionItem,
|
||||
|}>;
|
||||
|
||||
function ItemWithSeparator(props: ItemWithSeparatorProps): React.Node {
|
||||
@@ -508,7 +496,6 @@ function ItemWithSeparator(props: ItemWithSeparatorProps): React.Node {
|
||||
index,
|
||||
section,
|
||||
inverted,
|
||||
accessibilityCollectionItem,
|
||||
} = props;
|
||||
|
||||
const [leadingSeparatorHiglighted, setLeadingSeparatorHighlighted] =
|
||||
@@ -582,7 +569,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 after scrolled 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 after scrolled 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 adjust render area with non-zero initialScrollIndex until scrolled 1`] = `
|
||||
<RCTScrollView
|
||||
accessibilityCollection={
|
||||
Object {
|
||||
"columnCount": 1,
|
||||
"hierarchical": false,
|
||||
"itemCount": 20,
|
||||
"rowCount": 20,
|
||||
}
|
||||
}
|
||||
data={
|
||||
Array [
|
||||
Object {
|
||||
@@ -2547,14 +2347,6 @@ exports[`does not adjust render area with non-zero initialScrollIndex until scro
|
||||
|
||||
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 {
|
||||
@@ -2682,14 +2474,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 {
|
||||
@@ -2820,14 +2604,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 {
|
||||
@@ -2935,14 +2711,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 {
|
||||
@@ -3086,14 +2854,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 {
|
||||
@@ -3180,14 +2940,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 {
|
||||
@@ -3292,14 +3044,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 {
|
||||
@@ -3400,14 +3144,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 {
|
||||
@@ -3516,14 +3252,6 @@ exports[`renders items before initialScrollIndex on first batch tick when virtua
|
||||
|
||||
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 {
|
||||
@@ -3597,14 +3325,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 {
|
||||
@@ -3725,14 +3445,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 {
|
||||
@@ -3837,14 +3549,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 {
|
||||
@@ -3941,14 +3645,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 {
|
||||
@@ -4056,14 +3752,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 {
|
||||
@@ -4157,14 +3845,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 {
|
||||
@@ -4293,14 +3973,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 {
|
||||
@@ -4389,14 +4061,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 {
|
||||
@@ -4534,14 +4198,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 {
|
||||
@@ -4629,14 +4285,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 {
|
||||
@@ -4844,14 +4492,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 {
|
||||
|
||||
@@ -175,20 +175,6 @@ public abstract class BaseViewManager<T extends View, C extends LayoutShadowNode
|
||||
view.setTag(R.id.accessibility_role, AccessibilityRole.fromValue(accessibilityRole));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ReactProp(name = ViewProps.ACCESSIBILITY_COLLECTION)
|
||||
public void setAccessibilityCollection(
|
||||
@NonNull T view, @Nullable ReadableMap accessibilityCollection) {
|
||||
view.setTag(R.id.accessibility_collection, accessibilityCollection);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ReactProp(name = ViewProps.ACCESSIBILITY_COLLECTION_ITEM)
|
||||
public void setAccessibilityCollectionItem(
|
||||
@NonNull T view, @Nullable ReadableMap accessibilityCollectionItem) {
|
||||
view.setTag(R.id.accessibility_collection_item, accessibilityCollectionItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ReactProp(name = ViewProps.ACCESSIBILITY_STATE)
|
||||
public void setViewState(@NonNull T view, @Nullable ReadableMap accessibilityState) {
|
||||
|
||||
@@ -31,14 +31,6 @@ public abstract class BaseViewManagerAdapter<T extends View>
|
||||
@Override
|
||||
public void setAccessibilityRole(@NonNull T view, @Nullable String accessibilityRole) {}
|
||||
|
||||
@Override
|
||||
public void setAccessibilityCollection(
|
||||
@NonNull T view, @Nullable ReadableMap accessibilityCollection) {}
|
||||
|
||||
@Override
|
||||
public void setAccessibilityCollectionItem(
|
||||
@NonNull T view, @Nullable ReadableMap accessibilityCollectionItem) {}
|
||||
|
||||
@Override
|
||||
public void setViewState(@NonNull T view, @Nullable ReadableMap accessibilityState) {}
|
||||
|
||||
|
||||
@@ -48,12 +48,6 @@ public abstract class BaseViewManagerDelegate<T extends View, U extends BaseView
|
||||
case ViewProps.ACCESSIBILITY_STATE:
|
||||
mViewManager.setViewState(view, (ReadableMap) value);
|
||||
break;
|
||||
case ViewProps.ACCESSIBILITY_COLLECTION:
|
||||
mViewManager.setAccessibilityCollection(view, (ReadableMap) value);
|
||||
break;
|
||||
case ViewProps.ACCESSIBILITY_COLLECTION_ITEM:
|
||||
mViewManager.setAccessibilityCollectionItem(view, (ReadableMap) value);
|
||||
break;
|
||||
case ViewProps.BACKGROUND_COLOR:
|
||||
mViewManager.setBackgroundColor(
|
||||
view, value == null ? 0 : ColorPropConverter.getColor(value, view.getContext()));
|
||||
|
||||
@@ -28,10 +28,6 @@ public interface BaseViewManagerInterface<T extends View> {
|
||||
|
||||
void setAccessibilityRole(T view, @Nullable String accessibilityRole);
|
||||
|
||||
void setAccessibilityCollection(T view, @Nullable ReadableMap accessibilityCollection);
|
||||
|
||||
void setAccessibilityCollectionItem(T view, @Nullable ReadableMap accessibilityCollectionItem);
|
||||
|
||||
void setViewState(T view, @Nullable ReadableMap accessibilityState);
|
||||
|
||||
void setBackgroundColor(T view, int backgroundColor);
|
||||
|
||||
-20
@@ -122,7 +122,6 @@ public class ReactAccessibilityDelegate extends ExploreByTouchHelper {
|
||||
TABLIST,
|
||||
TIMER,
|
||||
LIST,
|
||||
GRID,
|
||||
TOOLBAR;
|
||||
|
||||
public static String getValue(AccessibilityRole role) {
|
||||
@@ -153,8 +152,6 @@ public class ReactAccessibilityDelegate extends ExploreByTouchHelper {
|
||||
return "android.widget.Switch";
|
||||
case LIST:
|
||||
return "android.widget.AbsListView";
|
||||
case GRID:
|
||||
return "android.widget.GridView";
|
||||
case NONE:
|
||||
case LINK:
|
||||
case SUMMARY:
|
||||
@@ -245,22 +242,6 @@ public class ReactAccessibilityDelegate extends ExploreByTouchHelper {
|
||||
}
|
||||
final ReadableArray accessibilityActions =
|
||||
(ReadableArray) host.getTag(R.id.accessibility_actions);
|
||||
|
||||
final ReadableMap accessibilityCollectionItem =
|
||||
(ReadableMap) host.getTag(R.id.accessibility_collection_item);
|
||||
if (accessibilityCollectionItem != null) {
|
||||
int rowIndex = accessibilityCollectionItem.getInt("rowIndex");
|
||||
int columnIndex = accessibilityCollectionItem.getInt("columnIndex");
|
||||
int rowSpan = accessibilityCollectionItem.getInt("rowSpan");
|
||||
int columnSpan = accessibilityCollectionItem.getInt("columnSpan");
|
||||
boolean heading = accessibilityCollectionItem.getBoolean("heading");
|
||||
|
||||
AccessibilityNodeInfoCompat.CollectionItemInfoCompat collectionItemCompat =
|
||||
AccessibilityNodeInfoCompat.CollectionItemInfoCompat.obtain(
|
||||
rowIndex, rowSpan, columnIndex, columnSpan, heading);
|
||||
info.setCollectionItemInfo(collectionItemCompat);
|
||||
}
|
||||
|
||||
if (accessibilityActions != null) {
|
||||
for (int i = 0; i < accessibilityActions.size(); i++) {
|
||||
final ReadableMap action = accessibilityActions.getMap(i);
|
||||
@@ -485,7 +466,6 @@ public class ReactAccessibilityDelegate extends ExploreByTouchHelper {
|
||||
|| view.getTag(R.id.accessibility_state) != null
|
||||
|| view.getTag(R.id.accessibility_actions) != null
|
||||
|| view.getTag(R.id.react_test_id) != null
|
||||
|| view.getTag(R.id.accessibility_collection_item) != null
|
||||
|| view.getTag(R.id.accessibility_links) != null)) {
|
||||
ViewCompat.setAccessibilityDelegate(
|
||||
view,
|
||||
|
||||
@@ -146,8 +146,6 @@ public class ViewProps {
|
||||
public static final String Z_INDEX = "zIndex";
|
||||
public static final String RENDER_TO_HARDWARE_TEXTURE = "renderToHardwareTextureAndroid";
|
||||
public static final String ACCESSIBILITY_LABEL = "accessibilityLabel";
|
||||
public static final String ACCESSIBILITY_COLLECTION = "accessibilityCollection";
|
||||
public static final String ACCESSIBILITY_COLLECTION_ITEM = "accessibilityCollectionItem";
|
||||
public static final String ACCESSIBILITY_HINT = "accessibilityHint";
|
||||
public static final String ACCESSIBILITY_LIVE_REGION = "accessibilityLiveRegion";
|
||||
public static final String ACCESSIBILITY_ROLE = "accessibilityRole";
|
||||
|
||||
+20
-6
@@ -25,10 +25,13 @@ import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import android.widget.HorizontalScrollView;
|
||||
import android.widget.OverScroller;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.AccessibilityDelegateCompat;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.infer.annotation.Assertions;
|
||||
import com.facebook.react.common.ReactConstants;
|
||||
@@ -119,7 +122,22 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
|
||||
mReactBackgroundManager = new ReactViewBackgroundManager(this);
|
||||
mFpsListener = fpsListener;
|
||||
|
||||
ViewCompat.setAccessibilityDelegate(this, new ReactScrollViewAccessibilityDelegate());
|
||||
ViewCompat.setAccessibilityDelegate(
|
||||
this,
|
||||
new AccessibilityDelegateCompat() {
|
||||
@Override
|
||||
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
|
||||
super.onInitializeAccessibilityEvent(host, event);
|
||||
event.setScrollable(mScrollEnabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeAccessibilityNodeInfo(
|
||||
View host, AccessibilityNodeInfoCompat info) {
|
||||
super.onInitializeAccessibilityNodeInfo(host, info);
|
||||
info.setScrollable(mScrollEnabled);
|
||||
}
|
||||
});
|
||||
|
||||
mScroller = getOverScrollerFromParent();
|
||||
mReactScrollViewScrollState =
|
||||
@@ -129,10 +147,6 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
|
||||
: ViewCompat.LAYOUT_DIRECTION_LTR);
|
||||
}
|
||||
|
||||
public boolean getScrollEnabled() {
|
||||
return mScrollEnabled;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private OverScroller getOverScrollerFromParent() {
|
||||
OverScroller scroller;
|
||||
@@ -394,7 +408,7 @@ public class ReactHorizontalScrollView extends HorizontalScrollView
|
||||
}
|
||||
|
||||
/** Returns whether the given descendent is partially scrolled in view */
|
||||
public boolean isPartiallyScrolledInView(View descendent) {
|
||||
private boolean isPartiallyScrolledInView(View descendent) {
|
||||
int scrollDelta = getScrollDelta(descendent);
|
||||
descendent.getDrawingRect(mTempRect);
|
||||
return scrollDelta != 0 && Math.abs(scrollDelta) < mTempRect.width();
|
||||
|
||||
@@ -75,7 +75,6 @@ public class ReactScrollView extends ScrollView
|
||||
private final @Nullable OverScroller mScroller;
|
||||
private final VelocityHelper mVelocityHelper = new VelocityHelper();
|
||||
private final Rect mRect = new Rect(); // for reuse to avoid allocation
|
||||
private final Rect mTempRect = new Rect();
|
||||
private final Rect mOverflowInset = new Rect();
|
||||
|
||||
private boolean mActivelyScrolling;
|
||||
@@ -121,8 +120,6 @@ public class ReactScrollView extends ScrollView
|
||||
mScroller = getOverScrollerFromParent();
|
||||
setOnHierarchyChangeListener(this);
|
||||
setScrollBarStyle(SCROLLBARS_OUTSIDE_OVERLAY);
|
||||
|
||||
ViewCompat.setAccessibilityDelegate(this, new ReactScrollViewAccessibilityDelegate());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -194,10 +191,6 @@ public class ReactScrollView extends ScrollView
|
||||
mScrollEnabled = scrollEnabled;
|
||||
}
|
||||
|
||||
public boolean getScrollEnabled() {
|
||||
return mScrollEnabled;
|
||||
}
|
||||
|
||||
public void setPagingEnabled(boolean pagingEnabled) {
|
||||
mPagingEnabled = pagingEnabled;
|
||||
}
|
||||
@@ -306,19 +299,6 @@ public class ReactScrollView extends ScrollView
|
||||
super.requestChildFocus(child, focused);
|
||||
}
|
||||
|
||||
private int getScrollDelta(View descendent) {
|
||||
descendent.getDrawingRect(mTempRect);
|
||||
offsetDescendantRectToMyCoords(descendent, mTempRect);
|
||||
return computeScrollDeltaToGetChildRectOnScreen(mTempRect);
|
||||
}
|
||||
|
||||
/** Returns whether the given descendent is partially scrolled in view */
|
||||
public boolean isPartiallyScrolledInView(View descendent) {
|
||||
int scrollDelta = getScrollDelta(descendent);
|
||||
descendent.getDrawingRect(mTempRect);
|
||||
return scrollDelta != 0 && Math.abs(scrollDelta) < mTempRect.width();
|
||||
}
|
||||
|
||||
private void scrollToChild(View child) {
|
||||
Rect tempRect = new Rect();
|
||||
child.getDrawingRect(tempRect);
|
||||
|
||||
-154
@@ -1,154 +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.
|
||||
*/
|
||||
|
||||
package com.facebook.react.views.scroll;
|
||||
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityEvent;
|
||||
import androidx.core.view.AccessibilityDelegateCompat;
|
||||
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;
|
||||
import com.facebook.react.R;
|
||||
import com.facebook.react.bridge.AssertionException;
|
||||
import com.facebook.react.bridge.ReactSoftExceptionLogger;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.uimanager.ReactAccessibilityDelegate;
|
||||
|
||||
public class ReactScrollViewAccessibilityDelegate extends AccessibilityDelegateCompat {
|
||||
private final String TAG = ReactScrollViewAccessibilityDelegate.class.getSimpleName();
|
||||
|
||||
@Override
|
||||
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
|
||||
super.onInitializeAccessibilityEvent(host, event);
|
||||
if (host instanceof ReactScrollView || host instanceof ReactHorizontalScrollView) {
|
||||
onInitializeAccessibilityEventInternal(host, event);
|
||||
} else {
|
||||
ReactSoftExceptionLogger.logSoftException(
|
||||
TAG,
|
||||
new AssertionException(
|
||||
"ReactScrollViewAccessibilityDelegate should only be used with ReactScrollView or ReactHorizontalScrollView, not with class: "
|
||||
+ host.getClass().getSimpleName()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
|
||||
super.onInitializeAccessibilityNodeInfo(host, info);
|
||||
if (host instanceof ReactScrollView || host instanceof ReactHorizontalScrollView) {
|
||||
onInitializeAccessibilityNodeInfoInternal(host, info);
|
||||
} else {
|
||||
ReactSoftExceptionLogger.logSoftException(
|
||||
TAG,
|
||||
new AssertionException(
|
||||
"ReactScrollViewAccessibilityDelegate should only be used with ReactScrollView or ReactHorizontalScrollView, not with class: "
|
||||
+ host.getClass().getSimpleName()));
|
||||
}
|
||||
};
|
||||
|
||||
private void onInitializeAccessibilityEventInternal(View view, AccessibilityEvent event) {
|
||||
final ReadableMap accessibilityCollection =
|
||||
(ReadableMap) view.getTag(R.id.accessibility_collection);
|
||||
|
||||
if (accessibilityCollection != null) {
|
||||
event.setItemCount(accessibilityCollection.getInt("itemCount"));
|
||||
View contentView;
|
||||
if (view instanceof ViewGroup) {
|
||||
ViewGroup viewGroup = (ViewGroup) view;
|
||||
contentView = viewGroup.getChildAt(0);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
Integer firstVisibleIndex = null;
|
||||
Integer lastVisibleIndex = null;
|
||||
|
||||
if (!(contentView instanceof ViewGroup)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int index = 0; index < ((ViewGroup) contentView).getChildCount(); index++) {
|
||||
View nextChild = ((ViewGroup) contentView).getChildAt(index);
|
||||
boolean isVisible;
|
||||
if (view instanceof ReactScrollView) {
|
||||
ReactScrollView scrollView = (ReactScrollView) view;
|
||||
isVisible = scrollView.isPartiallyScrolledInView(nextChild);
|
||||
} else if (view instanceof ReactHorizontalScrollView) {
|
||||
ReactHorizontalScrollView scrollView = (ReactHorizontalScrollView) view;
|
||||
isVisible = scrollView.isPartiallyScrolledInView(nextChild);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
ReadableMap accessibilityCollectionItem =
|
||||
(ReadableMap) nextChild.getTag(R.id.accessibility_collection_item);
|
||||
|
||||
if (!(nextChild instanceof ViewGroup)) {
|
||||
return;
|
||||
}
|
||||
|
||||
int childCount = ((ViewGroup) nextChild).getChildCount();
|
||||
|
||||
// If this child's accessibilityCollectionItem is null, we'll check one more
|
||||
// nested child.
|
||||
// Happens when getItemLayout is not passed in FlatList which adds an additional
|
||||
// View in the hierarchy.
|
||||
if (childCount > 0 && accessibilityCollectionItem == null) {
|
||||
View nestedNextChild = ((ViewGroup) nextChild).getChildAt(0);
|
||||
if (nestedNextChild != null) {
|
||||
ReadableMap nestedChildAccessibility =
|
||||
(ReadableMap) nestedNextChild.getTag(R.id.accessibility_collection_item);
|
||||
if (nestedChildAccessibility != null) {
|
||||
accessibilityCollectionItem = nestedChildAccessibility;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isVisible == true && accessibilityCollectionItem != null) {
|
||||
if (firstVisibleIndex == null) {
|
||||
firstVisibleIndex = accessibilityCollectionItem.getInt("itemIndex");
|
||||
}
|
||||
lastVisibleIndex = accessibilityCollectionItem.getInt("itemIndex");
|
||||
}
|
||||
|
||||
if (firstVisibleIndex != null && lastVisibleIndex != null) {
|
||||
event.setFromIndex(firstVisibleIndex);
|
||||
event.setToIndex(lastVisibleIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void onInitializeAccessibilityNodeInfoInternal(
|
||||
View view, AccessibilityNodeInfoCompat info) {
|
||||
final ReactAccessibilityDelegate.AccessibilityRole accessibilityRole =
|
||||
(ReactAccessibilityDelegate.AccessibilityRole) view.getTag(R.id.accessibility_role);
|
||||
|
||||
if (accessibilityRole != null) {
|
||||
ReactAccessibilityDelegate.setRole(info, accessibilityRole, view.getContext());
|
||||
}
|
||||
|
||||
final ReadableMap accessibilityCollection =
|
||||
(ReadableMap) view.getTag(R.id.accessibility_collection);
|
||||
|
||||
if (accessibilityCollection != null) {
|
||||
int rowCount = accessibilityCollection.getInt("rowCount");
|
||||
int columnCount = accessibilityCollection.getInt("columnCount");
|
||||
boolean hierarchical = accessibilityCollection.getBoolean("hierarchical");
|
||||
|
||||
AccessibilityNodeInfoCompat.CollectionInfoCompat collectionInfoCompat =
|
||||
AccessibilityNodeInfoCompat.CollectionInfoCompat.obtain(
|
||||
rowCount, columnCount, hierarchical);
|
||||
info.setCollectionInfo(collectionInfoCompat);
|
||||
}
|
||||
|
||||
if (view instanceof ReactScrollView) {
|
||||
ReactScrollView scrollView = (ReactScrollView) view;
|
||||
info.setScrollable(scrollView.getScrollEnabled());
|
||||
} else if (view instanceof ReactHorizontalScrollView) {
|
||||
ReactHorizontalScrollView scrollView = (ReactHorizontalScrollView) view;
|
||||
info.setScrollable(scrollView.getScrollEnabled());
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -15,13 +15,7 @@
|
||||
<!--tag is used to store accessibilityRole tag-->
|
||||
<item type="id" name="accessibility_role"/>
|
||||
|
||||
<!--tag is used to store accessibilityCollection -->
|
||||
<item type="id" name="accessibility_collection"/>
|
||||
|
||||
<!--tag is used to store accessibilityCollectionItem -->
|
||||
<item type="id" name="accessibility_collection_item"/>
|
||||
|
||||
<!--tag is used to store accessibilityState -->
|
||||
<!--tag is used to store accessibilityState -->
|
||||
<item type="id" name="accessibility_state"/>
|
||||
|
||||
<!--tag is used to store accessibilityLabel tag-->
|
||||
|
||||
@@ -276,21 +276,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,114 +0,0 @@
|
||||
import 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 = () => {
|
||||
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