react-native-floating-label icon indicating copy to clipboard operation
react-native-floating-label copied to clipboard

Placeholder hides automatically

Open sudharsan1988 opened this issue 8 years ago • 1 comments

When I add the Factory, my placeholder got hidden. But this library works when I removed auto: 'none' on the options. Is this how it works or it can work with custom place holders too?

This one is not working: I mean the placeholder is not visible

var options = { auto: 'none',

fields: { firstName: { placeholder: 'FIRSTNAME', placeholderTextColor:'#FFFFFF', textAlign: 'center', factory: FloatingLabel, stylesheet: stylesheet, // overriding the style of the textbox }, lastName: { placeholder: 'LASTNAME', placeholderTextColor:'#FFFFFF', stylesheet: stylesheet, // overriding the style of the textbox }, email: { placeholder: 'EMAIL', placeholderTextColor:'#FFFFFF', keyboardType: 'email-address', //onSubmitEditing: () => this.refs.form.getComponent('password').refs.input.focus(), stylesheet: stylesheet, // overriding the style of the textbox }, password: { placeholder: 'PASSWORD', placeholderTextColor:'#FFFFFF', secureTextEntry: true, stylesheet: stylesheet, // overriding the style of the textbox }

} };

But this one works but don't show my custom placeholder,

var options = {

fields: { firstName: { placeholder: 'FIRSTNAME', placeholderTextColor:'#FFFFFF', textAlign: 'center', factory: FloatingLabel, stylesheet: stylesheet, // overriding the style of the textbox }, lastName: { placeholder: 'LASTNAME', placeholderTextColor:'#FFFFFF', stylesheet: stylesheet, // overriding the style of the textbox }, email: { placeholder: 'EMAIL', placeholderTextColor:'#FFFFFF', keyboardType: 'email-address', //onSubmitEditing: () => this.refs.form.getComponent('password').refs.input.focus(), stylesheet: stylesheet, // overriding the style of the textbox }, password: { placeholder: 'PASSWORD', placeholderTextColor:'#FFFFFF', secureTextEntry: true, stylesheet: stylesheet, // overriding the style of the textbox }

} };

Thank you for your help.

sudharsan1988 avatar Jun 30 '16 11:06 sudharsan1988

I solved this with custom labels in tcomb-form-native but text box still goes empty when validation occurs. For example, if I leave all the fields empty and press the button, I can see the validation and everything is fine. Here is the problem, when I try to fill the data but move onto other field without filling it, which makes that label/placeholder empty. But floating label displays on focus event.

Am I missing something here?

sudharsan1988 avatar Jun 30 '16 13:06 sudharsan1988