mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
25a16123a6
Summary: Issue https://github.com/facebook/react-native/issues/30964 .When using a screen reader, flatlist does not announce entrance/ exit from the flat list. ## Changelog [Android] [Changed] - Added support for accessibility role of "list" for flatlist and sectioned list Pull Request resolved: https://github.com/facebook/react-native/pull/31630 Test Plan: I have added accessibility role prop in flatlist and sectioned list in rntester app, that will announce entrance/ exit from flatlist and sectioned list. Reviewed By: kacieb Differential Revision: D29599351 Pulled By: blavalla fbshipit-source-id: e16ec69a694780d12f15f88a1e6bb5d7d77ac15f
89 lines
1.7 KiB
JavaScript
89 lines
1.7 KiB
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its 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 strict-local
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {SyntheticEvent} from '../../Types/CoreEventTypes';
|
|
|
|
// This must be kept in sync with the AccessibilityRolesMask in RCTViewManager.m
|
|
export type AccessibilityRole =
|
|
| 'none'
|
|
| 'button'
|
|
| 'togglebutton'
|
|
| 'link'
|
|
| 'search'
|
|
| 'image'
|
|
| 'keyboardkey'
|
|
| 'text'
|
|
| 'adjustable'
|
|
| 'imagebutton'
|
|
| 'header'
|
|
| 'summary'
|
|
| 'alert'
|
|
| 'checkbox'
|
|
| 'combobox'
|
|
| 'menu'
|
|
| 'menubar'
|
|
| 'menuitem'
|
|
| 'progressbar'
|
|
| 'radio'
|
|
| 'radiogroup'
|
|
| 'scrollbar'
|
|
| 'spinbutton'
|
|
| 'switch'
|
|
| 'tab'
|
|
| 'tablist'
|
|
| 'timer'
|
|
| 'list'
|
|
| 'toolbar';
|
|
|
|
// the info associated with an accessibility action
|
|
export type AccessibilityActionInfo = $ReadOnly<{
|
|
name: string,
|
|
label?: string,
|
|
...
|
|
}>;
|
|
|
|
// The info included in the event sent to onAccessibilityAction
|
|
export type AccessibilityActionEvent = SyntheticEvent<
|
|
$ReadOnly<{actionName: string, ...}>,
|
|
>;
|
|
|
|
export type AccessibilityState = {
|
|
disabled?: boolean,
|
|
selected?: boolean,
|
|
checked?: ?boolean | 'mixed',
|
|
busy?: boolean,
|
|
expanded?: boolean,
|
|
...
|
|
};
|
|
|
|
export type AccessibilityValue = $ReadOnly<{|
|
|
/**
|
|
* The minimum value of this component's range. (should be an integer)
|
|
*/
|
|
min?: number,
|
|
|
|
/**
|
|
* The maximum value of this component's range. (should be an integer)
|
|
*/
|
|
max?: number,
|
|
|
|
/**
|
|
* The current value of this component's range. (should be an integer)
|
|
*/
|
|
now?: number,
|
|
|
|
/**
|
|
* A textual description of this component's value. (will override minimum, current, and maximum if set)
|
|
*/
|
|
text?: string,
|
|
|}>;
|