react-native/Libraries
Ziqi Chen 121e2e5ca6 accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3
Summary:
Previously, I created two props, `accessibilityRole` and `accessibilityStates` for view. These props were intended to be a cross-platform solution to replace  `accessibilityComponentType` on Android and `accessibilityTraits` on iOS.

In this stack, I ran a code mod to replace instances of the two old properties used in our codebase with the new ones.
For this diff, I did a search for all the remnant uses of `accessibilityComponentType` that was not caught by my script, and I manually changed them to `accessibilityRole` and `accessibilityStates`. If the same prop also set `accessibilityTraits` I also removed that here because the two new props works on both platforms.

It was difficult to write a script for this, because most of them were contextual changes.
Out of the contextual changes, most of them followed one of these two patterns:

Before:

```
const accessibilityComponentType = 'button';
const accessibilityTraits = ['button'];

if (this.props.checked) {
  accessibilityTraits.push('selected');
}
if (this.props.disabled) {
 accessibilityTraits.push('disabled');
}

      contentView = (
        <AdsManagerTouchableHighlight
          accessibilityComponentType={accessibilityComponentType}
          accessibilityTraits={accessibilityTraits}
```

After:
      const accessibilityRole = 'button';
      const accessibilityStates = [];

        if (this.props.checked) {
          accessibilityStates.push('selected');
        }
        if (this.props.disabled) {
           accessibilityStates.push('disabled');
        }

      contentView = (
        <AdsManagerTouchableHighlight
          accessibilityRole={accessibilityRole}
          accessibilityStates={accessibilityStates}

Before:

```
  <PressableBackground
          accessible={this.props.accessible}
          accessibilityLabel={this.props.accessibilityLabel}
          accessibilityTraits={this.props.accessibilityTraits}
```

After:

```
  <PressableBackground
          accessible={this.props.accessible}
          accessibilityLabel={this.props.accessibilityLabel}
          accessibilityRole={this.props.accessibilityRole}
          accessibilityRole={this.props.accessibilityStates}
```

In addition to changing the props on the components,
Another fix I had to do was to add props  accessibilityRole and accessibilityStates to components that don't directly inherit properties from view including text input and touchables.

Reviewed By: PeteTheHeat

Differential Revision: D8943499

fbshipit-source-id: fbb40a5e5f5d630b0fe56a009ff24635d4c8cc93
2018-07-25 23:48:26 -07:00
..
ART RN: Move ART Canvas Workaround 2018-07-19 19:02:13 -07:00
ActionSheetIOS Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
Alert Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Animated Add FlatList and SectionList to Animated exports 2018-07-17 22:35:28 -07:00
AppState Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
BatchedBridge Eliminate circular dependency between MessageQueue and JSTimers modules. (#19526) 2018-06-15 17:06:29 -07:00
Blob Flow strictify possible files in RN core 2018-06-20 00:47:21 -07:00
BugReporting Flow strictify possible files in RN core 2018-06-20 00:47:21 -07:00
CameraRoll Fix crash in RCTImagePicker on iOS 2018-07-12 10:33:01 -07:00
Color Bump Prettier to 1.13.4 on xplat 2018-06-06 05:32:06 -07:00
Components accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3 2018-07-25 23:48:26 -07:00
Core Eliminate circular dependency between MessageQueue and JSTimers modules. (#19526) 2018-06-15 17:06:29 -07:00
EventEmitter Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Experimental Adding custom view to swipeable component 2018-06-21 10:33:07 -07:00
Geolocation Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
Image Added ImageEditor comment to clarify image access policy. 2018-07-16 13:17:16 -07:00
Inspector RN: Fix Element Inspector w/ Start + End Styles 2018-06-26 13:33:43 -07:00
Interaction RN: Remove ReactPerf References 2018-05-15 13:16:57 -07:00
JSInspector Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
LayoutAnimation Remove @providesModule from all modules 2018-04-25 07:37:10 -07:00
Linking Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
LinkingIOS Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
Lists VirtualizedList: Fix spacer size calculation (#18105) 2018-07-20 00:17:05 -07:00
Modal Switch to Platform.isTV to pass Android Flow 2018-06-10 13:45:57 -07:00
NativeAnimation Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
Network Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
Performance Flow strictify possible files in RN core 2018-06-20 00:47:21 -07:00
PermissionsAndroid Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
PushNotificationIOS Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
RCTTest Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
ReactNative Flow strictify possible files in RN core 2018-06-20 00:47:21 -07:00
Renderer React sync for revisions ca0941f...bc1ea9c 2018-07-25 16:17:51 -07:00
Sample iOS OSS: deployment target 8.0 => 9.0 2018-05-22 01:16:45 -07:00
Settings Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
Share Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
Storage Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
StyleSheet RN: Refine `StyleSheet.compose` Flow Type 2018-07-17 18:03:00 -07:00
SurfaceBackedComponent Update license headers for MIT license 2018-02-16 18:31:53 -08:00
SurfaceHostingComponent Update license headers for MIT license 2018-02-16 18:31:53 -08:00
Text accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 1/3 2018-07-25 23:48:26 -07:00
Types Flow strictify possible files in RN core 2018-06-20 00:47:21 -07:00
Utilities Flow v0.76.0 2018-07-09 08:17:51 -07:00
Vibration Update Xcode projects (#19574) 2018-06-19 23:48:12 -07:00
WebSocket - Correct fishhook import in RCTReconnectingWebSocket Fixes #16039 (#16271) 2018-06-28 11:49:32 -07:00
Wrapper Update additional license headers 2018-03-08 12:10:14 -08:00
YellowBox YellowBox: Fix Off-By-1 Content Rendering Bug 2018-06-26 13:33:42 -07:00
fishhook Merge fishhook.xcodeproj in RCTWebSocket 2017-08-09 07:48:09 -07:00
polyfills fix missing prettier file (#20001) 2018-07-02 10:48:06 -07:00
react-native Flow strictify possible files in RN core 2018-06-20 00:47:21 -07:00
vendor Upgrade Prettier to 1.13.6 on fbsource 2018-06-27 03:32:42 -07:00
.npmignore npmignore: ignore tests and fixtures 2018-02-27 08:42:14 -08:00
Promise.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00
UTFSequence.js RN: A wild YellowBox has appeared! 2018-06-11 18:31:18 -07:00
promiseRejectionIsError.js Prettier React Native Libraries 2018-05-10 19:10:38 -07:00