Skip to content

Commit 1e5425e

Browse files
Merge pull request danielweinmann#10 from guilhermecomum/master
Fixes icon alignment on LabeledTextInput
2 parents 9d6d771 + f26b799 commit 1e5425e

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

components/LabeledTextInput.js

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export default class LabeledTextInput extends Component {
8888
paddingHorizontal: 10,
8989
}, style]}
9090
>
91-
{ this.renderIcon() }
9291
<Text
9392
style={[{
9493
fontSize: 12,
@@ -98,26 +97,30 @@ export default class LabeledTextInput extends Component {
9897
>
9998
{label}
10099
</Text>
101-
<TextInput
102-
clearButtonMode='while-editing'
103-
underlineColorAndroid='transparent'
104-
returnKeyType={ multiline ? 'default' : (nextInput ? 'next' : 'done') }
105-
onSubmitEditing={this.handleSubmitEditing.bind(this)}
106-
{ ...this.props }
107-
onFocus={this.handleFocus.bind(this)}
108-
onBlur={onBlur}
109-
ref='input'
110-
value={value}
111-
style={[{
112-
height: 24,
113-
paddingHorizontal: 10,
114-
fontSize: 12,
115-
lineHeight: 24,
116-
borderWidth: StyleSheet.hairlineWidth,
117-
borderColor: 'lightgray',
118-
backgroundColor: 'white',
119-
}, inputStyle]}
120-
/>
100+
<View style={[{ flex: 1, flexDirection: 'row', alignItems: 'center'}]}>
101+
{ this.renderIcon() }
102+
<TextInput
103+
clearButtonMode='while-editing'
104+
underlineColorAndroid='transparent'
105+
returnKeyType={ multiline ? 'default' : (nextInput ? 'next' : 'done') }
106+
onSubmitEditing={this.handleSubmitEditing.bind(this)}
107+
{ ...this.props }
108+
onFocus={this.handleFocus.bind(this)}
109+
onBlur={onBlur}
110+
ref='input'
111+
value={value}
112+
style={[{
113+
flex: 1,
114+
height: 24,
115+
paddingHorizontal: 10,
116+
fontSize: 12,
117+
lineHeight: 24,
118+
borderWidth: StyleSheet.hairlineWidth,
119+
borderColor: 'lightgray',
120+
backgroundColor: 'white',
121+
}, inputStyle]}
122+
/>
123+
</View>
121124
{ this.renderMessage() }
122125
</View>
123126
)

0 commit comments

Comments
 (0)