Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletions src/components/Picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ import Icon from '../Icon';
import * as Expensicons from '../Icon/Expensicons';
import FormHelpMessage from '../FormHelpMessage';
import Text from '../Text';
import CONST from '../../CONST';
import styles from '../../styles/styles';
import variables from '../../styles/variables';
import pickerStyles from './pickerStyles';
import getOperatingSystem from '../../libs/getOperatingSystem';

const propTypes = {
/** Picker label */
Expand Down Expand Up @@ -104,28 +103,23 @@ class Picker extends PureComponent {
};

this.onInputChange = this.onInputChange.bind(this);
this.placeholder = this.props.placeholder;
this.items = this.props.items;

// Windows will reuse the text color of the select for each one of the options
// so we might need to color accordingly so it doesn't blend with the background.
this.placeholder = _.isEmpty(this.props.placeholder) ? {} : {
...this.props.placeholder,
color: variables.pickerOptionsTextColor,
};
this.items = _.map(this.props.items, item => (
{
...item,
color: variables.pickerOptionsTextColor,
}
));
}

componentDidMount() {
this.setDefaultValue();

// Windows will reuse the text color of the select for each one of the options
// so we might need to color accordingly so it doesn't blend with the background.
if (getOperatingSystem() === CONST.OS.WINDOWS) {
this.placeholder = _.isEmpty(this.placeholder) ? {} : {
...this.placeholder,
color: '#002140',
};

this.items = _.map(this.items, item => (
{
...item,
color: '#002140',
}
));
}
}

componentDidUpdate(prevProps) {
Expand Down
1 change: 1 addition & 0 deletions src/styles/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ export default {
INACTIVE_LABEL_TRANSLATE_Y: getValueUsingPixelRatio(16, 21),
sliderBarHeight: 8,
sliderKnobSize: 26,
pickerOptionsTextColor: '#002140',
};