mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
5ddb9977e6
Summary: Adding grid role to ViewAccessibility to fix flow errors. fixes https://github.com/facebook/react-native/issues/30861 fixes https://github.com/facebook/react-native/issues/30972 ## Changelog [General] [Fixed] - Adding grid role to ViewAccessibility to fix flow errors. Pull Request resolved: https://github.com/facebook/react-native/pull/34267 Test Plan: <details><summary>flow error for missing accessibilityRole type grid</summary> <p> <image src="https://user-images.githubusercontent.com/24992535/180728969-beccb7f7-d882-4a94-831d-1c08822fc030.png" width="800" /> </p> </details> <details><summary>adding grid role to ScrollView</summary> <p> https://user-images.githubusercontent.com/24992535/180721100-62de76af-ea23-44a6-816e-f6fa39835b77.mp4 </p> </details> <details><summary>adding grid role to FlatList</summary> <p> https://user-images.githubusercontent.com/24992535/180724852-861c2981-0b06-4c66-a983-0017785062fe.mp4 </p> </details> <details><summary>adding grid role to SectionList</summary> <p> https://user-images.githubusercontent.com/24992535/180788810-d1869381-1e6b-42aa-b9b2-a84aece41326.mp4 </p> </details> Reviewed By: NickGerleman Differential Revision: D38121921 Pulled By: dmitryrykun fbshipit-source-id: 3bc335b3a525e75ae2e032f6a35540b3e95cd6a8
91 lines
1.8 KiB
JavaScript
91 lines
1.8 KiB
JavaScript
/**
|
|
* 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 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'
|
|
| 'tabbar'
|
|
| 'tablist'
|
|
| 'timer'
|
|
| 'list'
|
|
| 'toolbar'
|
|
| 'grid';
|
|
|
|
// 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?: Stringish,
|
|
|}>;
|