mayank-patel / react-native-floating-labels

React Native Floating Labels Library

Home Page:https://www.npmjs.com/package/react-native-floating-labels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Floating label doesn't work properly with events

AhsanAk opened this issue · comments

I am having issue with FloatingLabel, whenever I use onChangeText event, my floating label floats at his starting position when I write something. But it works perfectly when I don't use onChangeText , onBlur and other events. Please help!

    <FloatingLabel
              labelStyle={Styles.labelInput}
              inputStyle={Styles.input}
              style={Styles.formInput}
              underlineColorAndroid="transparent"
              secureTextEntry={true}
              onChangeText={(password) => this.setState({password})}
          >Password</FloatingLabel>

Styles:

 labelInput: {
    fontSize: 16,
  },

  formInput: {
    borderBottomWidth: 1,
    borderColor: '#e6e6e6',
  },
  input: {
    fontSize: 14,
    borderWidth: 0
  }

Please help!

@AhsanAk I had the same problem and had to dig into code to find a solution - just pass value prop (as you do for regular TextInput) and it should work.