react-native/React
Adam Comella 6fbc2c9972 iOS: Remove leading space from accessibilityLabel
Summary:
In some cases, the accessibilityLabel contains a leading space. This is because `RCTRecursiveAccessibilityLabel` adds a space before every iteration of the loop including the first.

After this change, the contract is that:
  - `RCTRecursiveAccessibilityLabel` always returns a string with a leading space.
  - `accessibilityLabel` never returns a string with a leading space.

**Test plan**

I created a test app with the following code:

```
<View style={{height: 100, width: 100, backgroundColor: 'steelblue'}} accessible={true}>
  <View style={{height: 20, width: 20, backgroundColor: 'red'}} accessibilityLabel='One' />
  <View style={{height: 20, width: 20, backgroundColor: 'yellow'}} accessibilityLabel='Two' />
  <View style={{height: 20, width: 20, backgroundColor: 'green'}} accessibilityLabel='Three' />
</View>
```

Before this change, the accessibilityLabel of the outermost View was " One Two Three" (notice the leading space).

After this change, it is "One Two Three" as desired.

Adam
Closes https://github.com/facebook/react-native/pull/12269

Reviewed By: javache

Differential Revision: D4596761

Pulled By: shergin

fbshipit-source-id: 7d5ff704e858d9f277d1547339a2831ffa90f592
2017-02-22 11:16:13 -08:00
..
Base Simplifying Struct definition. 2017-02-20 04:30:19 -08:00
CxxBridge Create NSDataBigString 2017-02-20 05:00:58 -08:00
CxxModule Move some utilities to RCTCxxUtils 2017-02-16 14:02:03 -08:00
CxxUtils Move RCTFollyConvert to the correct namespace 2017-02-16 06:59:27 -08:00
Executors Simplifying Struct definition. 2017-02-20 04:30:19 -08:00
Modules Simplifying mess with RCTRootViewSizeFlexibility 2017-02-19 23:19:47 -08:00
Profiler Enable perf monitor for CxxBridge 2017-02-09 12:47:04 -08:00
React.xcodeproj Splitting `RCTRootView.m`, decoupling RCTRootContentView 2017-02-19 23:19:47 -08:00
ReactCxx.xcodeproj Create NSDataBigString 2017-02-20 05:00:58 -08:00
Views iOS: Remove leading space from accessibilityLabel 2017-02-22 11:16:13 -08:00
folly.xcconfig Fork React.xcodeproj to build the C++ bridge 2017-02-01 14:14:32 -08:00