Skip to content

Commit

Permalink
Fix flex bugs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sohobloo committed Jan 10, 2017
1 parent 295c95c commit b409774
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
23 changes: 12 additions & 11 deletions components/ModalDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,31 +278,35 @@ export default class ModalDropdown extends Component {
props.key = preservedProps.key;
props.onPress = preservedProps.onPress;
switch (row.type.displayName) {
case 'TouchableHighlight': {
case 'TouchableHighlight':
{
return (
<TouchableHighlight {...props}>
{row.props.children}
</TouchableHighlight>
);
}
break;
case 'TouchableOpacity': {
case 'TouchableOpacity':
{
return (
<TouchableOpacity {...props}>
{row.props.children}
</TouchableOpacity>
);
}
break;
case 'TouchableWithoutFeedback': {
case 'TouchableWithoutFeedback':
{
return (
<TouchableWithoutFeedback {...props}>
{row.props.children}
</TouchableWithoutFeedback>
);
}
break;
case 'TouchableWithNativeFeedback': {
case 'TouchableWithNativeFeedback':
{
return (
<TouchableWithNativeFeedback {...props}>
{row.props.children}
Expand Down Expand Up @@ -350,18 +354,17 @@ export default class ModalDropdown extends Component {

const styles = StyleSheet.create({
button: {
flexGrow: 1,
justifyContent: 'center',
},
buttonText: {
fontSize: 12,
},
modal: {
flex: 1,
flexGrow: 1,
},
dropdown: {
position: 'absolute',
height: (32 + StyleSheet.hairlineWidth) * 5,
height: (33 + StyleSheet.hairlineWidth) * 5,
borderWidth: StyleSheet.hairlineWidth,
borderColor: 'lightgray',
borderRadius: 2,
Expand All @@ -372,14 +375,12 @@ const styles = StyleSheet.create({
alignSelf: 'center',
},
list: {
flex: 1,
//flexGrow: 1,
},
rowText: {
flex: 1,
paddingHorizontal: 6,
paddingVertical: 10,
fontSize: 11,
height: 32,
lineHeight: 32,
color: 'gray',
backgroundColor: 'white',
textAlignVertical: 'center',
Expand Down
4 changes: 1 addition & 3 deletions example/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ const styles = StyleSheet.create({
backgroundColor: 'cornflowerblue',
},
dropdown_2_text: {
height: 40,
lineHeight: 40,
marginVertical: 10,
marginHorizontal: 6,
fontSize: 18,
color: 'white',
Expand All @@ -258,7 +257,6 @@ const styles = StyleSheet.create({
borderRadius: 3,
},
dropdown_2_row: {
flex: 1,
flexDirection: 'row',
height: 40,
alignItems: 'center',
Expand Down

0 comments on commit b409774

Please sign in to comment.