Skip to content

Commit

Permalink
[fix] Picker.Item support for 'color' prop
Browse files Browse the repository at this point in the history
Not well supported by browsers.

Fix #810
  • Loading branch information
necolas committed Apr 8, 2018
1 parent 2050730 commit 1aec803
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/react-native-web/src/exports/Picker/PickerItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export default class PickerItem extends Component<Props> {
};

render() {
const { label, testID, value } = this.props;
return createElement('option', { testID, value }, label);
const { color, label, testID, value } = this.props;
const style = { color };
return createElement('option', { style, testID, value }, label);
}
}
10 changes: 9 additions & 1 deletion website/storybook/1-components/Picker/PickerScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,16 @@ const PickerScreen = () => (
<Description>Individual selectable item in a Picker.</Description>

<Section title="Props">
<DocItem name="label" typeInfo="string" description="Text to display for this item" />
<DocItem
name="color"
typeInfo="?color"
description="Color of the item label. (Limited by browser support.)"
/>

<DocItem name="label" typeInfo="string" description="Text to display for this item." />

<DocItem name="testID" typeInfo="?string" />

<DocItem
name="value"
typeInfo="?number | string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const PickerExample = props => (
);

const styles = StyleSheet.create({
rootl: {
root: {
alignItems: 'flex-start'
}
});
Expand Down

0 comments on commit 1aec803

Please sign in to comment.