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
Original file line number Diff line number Diff line change
Expand Up @@ -182,30 +182,44 @@ export class ChoiceSetInput extends React.Component {
</View>
</TouchableOpacity>}
{((Platform.OS === Constants.PlatformIOS) ? this.state.isPickerSelected : true) &&
<Picker
mode={'dropdown'}
itemStyle={this.styleConfig.picker}
selectedValue={this.getPickerInitialValue(addInputItem)}
onValueChange={
(itemValue) => {
this.setState({
selectedPickerValue: itemValue,
isError: false
})
addInputItem(this.id, { value: itemValue, errorState: false });
}}>
{this.choices.map((item, key) => (
<Picker.Item
label={item.title}
value={item.value} key={key}
/>)
)}
</Picker>
this.getPickerComponent(addInputItem)
}
</View>
)
}

getPickerComponent(addInputItem) {
let picker = (
<Picker
mode={'dropdown'}
itemStyle={this.styleConfig.picker}
selectedValue={this.getPickerInitialValue(addInputItem)}
onValueChange={
(itemValue) => {
this.setState({
selectedPickerValue: itemValue,
isError: false
})
addInputItem(this.id, { value: itemValue, errorState: false });
}}>
{this.choices.map((item, key) => (
<Picker.Item
label={item.title}
value={item.value} key={key}
/>)
)}
</Picker>
);
if (Platform.OS == Constants.PlatformAndroid) {
picker = (
<View style={this.styleConfig.dropdown}>
{picker}
</View>
)
}
return picker;
}

/**
* @description Renders CheckBoxes component as per the json
*/
Expand Down
32 changes: 25 additions & 7 deletions source/community/reactnative/src/utils/theme-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,31 @@ export const defaultThemeConfig = {
inactiveColor: Constants.LightBlack,
},
dropdown: {
flexDirection: Constants.FlexRow,
justifyContent: Constants.SpaceBetween,
alignItems: Constants.FlexEnd,
borderWidth: 1,
backgroundColor: Constants.WhiteColor,
borderColor: Constants.LightGreyColor,
borderRadius: 5,
ios: {
flexDirection: Constants.FlexRow,
justifyContent: Constants.SpaceBetween,
alignItems: Constants.FlexEnd,
borderWidth: 1,
backgroundColor: Constants.WhiteColor,
borderColor: Constants.LightGreyColor,
borderRadius: 5,
},
android: {
borderWidth: 1,
backgroundColor: Constants.WhiteColor,
borderColor: Constants.LightGreyColor,
borderRadius: 5,
backgroundColor: Constants.LightGreyColor,
},
windows: {
flexDirection: Constants.FlexRow,
justifyContent: Constants.SpaceBetween,
alignItems: Constants.FlexEnd,
borderWidth: 1,
backgroundColor: Constants.WhiteColor,
borderColor: Constants.LightGreyColor,
borderRadius: 5,
}
},
dropdownText: {
color: Constants.BlackColor,
Expand Down