Fix Android FlatList accessibility collection positions#57008
Fix Android FlatList accessibility collection positions#57008popsiclelmlm wants to merge 1 commit into
Conversation
|
Hi @popsiclelmlm! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
retry check |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
967cdbf to
e9b2647
Compare
Summary:
Fixes #30973. Related to #30975 and #30977.
On Android, FlatList and VirtualizedList now provide accessibility collection metadata so TalkBack can report collection positions for rendered items. FlatList sets list/grid collection info, attaches collection item data to rendered item roots, and the Android scroll delegate resolves visible item ranges from nested tagged descendants.
Relation to previous attempts
This area has prior history in #33180 and the currently open #56692.
accessibilityCollectionandaccessibilityCollectionItem, so this PR focuses on wiring list metadata through FlatList/VirtualizedList instead of re-adding the broader native View API surface.itemCount,rowCount,columnCount, andhierarchical).accessibilityCollectionItemto the rendered item root when possible, while preserving an explicitaccessibilityCollectionItemsupplied by user code. For multi-column FlatList rows, each rendered item gets its own item/column index.role,accessibilityRole, andaccessibilityCollectionprops.accessibilityCollectionItemstays an internal native prop wiring detail for these list components.Changelog:
[ANDROID] [FIXED] - Fix FlatList accessibility collection position announcements.
Test Plan:
PATH=/Users/liumin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH ./node_modules/.bin/jest packages/react-native/Libraries/Lists/__tests__/FlatList-test.js --runInBandPATH=/Users/liumin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH ./node_modules/.bin/jest packages/virtualized-lists/Lists/__tests__/VirtualizedList-test.js --runInBandPATH=/Users/liumin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH yarn build-types --validatePATH=/Users/liumin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH YARN_BINARY=/Users/liumin/.cache/node/corepack/v1/yarn/1.22.22/bin/yarn ./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest --tests com.facebook.react.views.scroll.ReactScrollViewAccessibilityDelegateTest -Preact.internal.useHermesStable=truePATH=/Users/liumin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH YARN_BINARY=/Users/liumin/.cache/node/corepack/v1/yarn/1.22.22/bin/yarn ./gradlew :packages:react-native:ReactAndroid:ktfmtCheck -Preact.internal.useHermesStable=truePATH=/Users/liumin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH ./node_modules/.bin/prettier --check packages/react-native/Libraries/Lists/FlatList.js packages/react-native/Libraries/Lists/__tests__/FlatList-test.js packages/virtualized-lists/Lists/VirtualizedList.js packages/virtualized-lists/Lists/VirtualizedListCellRenderer.js packages/virtualized-lists/Lists/VirtualizedListProps.jsgit diff --check