Skip to content

Commit

Permalink
Brings accessibilityLabel into PickerAndroid
Browse files Browse the repository at this point in the history
Summary:
Hi!

I found problem with accessibilityLabel on PickerAndroid.
There's no value in content-desc attribute while accessibilityLabel is correct.
I found that accessibilityLabel is not propagated into native components via
native props.

This PR brings accessibilityLabel for PickerAndroid.

Without this solution my appium tests fails, for example:

My code:
```jsx
<Picker
    style={this.props.style}
    selectedValue={this.props.value}
    onValueChange={this.onChange}
    disabled={this.props.disabled}
    accessibilityLabel="select_wineType">
    // Chilren
</Picker>
```

```sh
✖  Error: element (~select_wineType) still not visible after 5000ms
```
Because xml of this view is (look into content-desc of Spinner):
```xml
<android.widget.Spinner index="0" text="" class="android.widget.Spinner" package="com.hello_github" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="true" long-clickable="false" password=
Closes #8873

Differential Revision: D3831691

Pulled By: spicyj

fbshipit-source-id: a494f22cb8be8cd6964981fe7ef7d9ff3773bcce
  • Loading branch information
isnifer authored and Facebook Github Bot 8 committed Sep 7, 2016
1 parent a31a291 commit efd8b10
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/Components/Picker/PickerAndroid.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class PickerAndroid extends React.Component {
selected: this.state.initialSelectedIndex,
testID: this.props.testID,
style: [styles.pickerAndroid, this.props.style],
accessibilityLabel: this.props.accessibilityLabel,
};

return <Picker ref={REF_PICKER} {...nativeProps} />;
Expand Down

0 comments on commit efd8b10

Please sign in to comment.