Skip to content

Commit 76473fa

Browse files
author
alvaromb
committed
Solved issue when getting the element value and passing an initial value
1 parent f8753f7 commit 76473fa

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ bower_components
1212

1313
Example
1414

15+
App.js

FloatingLabel.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ class FloatingLabel extends Component {
77
constructor (props) {
88
super(props)
99
this.state = {
10-
fieldFocused: false,
11-
value: undefined,
12-
fadeAnim: new Animated.Value(0),
10+
fieldFocused: (props.value) ? true : false,
11+
value: (props.value) ? String(props.value) : undefined,
12+
fadeAnim: (props.value) ? new Animated.Value(1) : new Animated.Value(0),
1313
placeholderString: undefined,
1414
}
1515
}
@@ -75,8 +75,8 @@ class FloatingLabel extends Component {
7575
secureTextEntry={locals.secureTextEntry}
7676
selectionState={locals.selectionState}
7777
onChangeText={(value) => {
78-
self._onChangeText.bind(self, value, locals)
7978
locals.onChange(value)
79+
self._onChangeText.bind(self, value, locals)
8080
}}
8181
placeholder={placeholderString}
8282
maxLength={locals.maxLength}

0 commit comments

Comments
 (0)