Skip to content

Commit

Permalink
Fix text alignment issue on android
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Guenther committed Apr 6, 2017
1 parent d82906a commit a0f6528
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/Input.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,6 @@ import {TextInput, View} from 'react-native'
import styled from 'styled-components/native'
import defaultTheme from './Theme'

/**
* Calculate the height based on the given field properties.
* The inline label and multiline properties affect the height.
*
* @param {Object} props
* @returns {int}
*/
const calculateHeight = (props) => {
let height = props.theme.FormGroup.height

if (props.multiline) {
height = props.theme.FormGroup.height * (props.numberOfLines - 1)
}

if (props.inlineLabel) {
height -= props.theme.FormGroup.borderWidth * 2
}

return (height)
}

/**
* Calculates the flex value based on the inlineLabel and numberOfLines
* properties.
Expand Down Expand Up @@ -66,7 +45,6 @@ const determineTextOrientation = (props) => {
const InputWrapper = styled.View`
flex: ${props => calculateFlexValue(props)};
justify-content: center;
height: ${props => calculateHeight(props)};
`

InputWrapper.defaultProps = {
Expand All @@ -78,7 +56,6 @@ const StyledInput = styled.TextInput`
flex: ${props => props.inlineLabel ? .5 : 1};
color: ${props => props.theme.Input.color};
font-size: ${props => props.theme.BaseInput.fontSize};
height: ${props => calculateHeight(props)};
line-height: ${props => props.theme.BaseInput.lineHeight};
text-align-vertical: ${props => determineTextOrientation(props)};
`
Expand Down

0 comments on commit a0f6528

Please sign in to comment.