Closed lucj closed 4 years ago
Was not sure about the default value to specify. What do you prefer ? Is 50 chars fine ?
@lucj
Make it conditional
change to
let {autoCapitalize, autoCorrect, clearButtonMode, editable, multiline, keyboardType} = props; let otherProps = {autoCapitalize, autoCorrect, clearButtonMode, editable, multiline, keyboardType} ;
if (props.hasOwnProperty('maxLength')) otherProps = {...otherProps, maxLength: props.maxLength} <Input label={label} value={value} placeholder={placeholder} errorMessage={errorMessage} secureTextEntry={visible} onChangeText={onChangeText} testID={testID}
{...otherProps}
containerStyle={styles.containerStyle}
labelStyle={styles.labelStyle}
errorProps={{testID: `${testID}InputError`}}
/>
Something like this
Ok, I've changed the thing as you suggested. Let me know if this is fine.
Also, do not know if this related to the way the props are passed to the TextInput but with version 1.1.9, I still have the keyboard appearing with Caps lock on for the email-address even if the fields are defined with:
const fields = [
{name: 'username', label: 'Email Address', required: true, type: 'email-address', autoCapitalize: 'none'},
{name: 'password', label: 'Password', required: true, secure: true, autoCapitalize: 'none' }
];
@lucj Take a look at the documentation
I had no more success with this field's definition (sample from the documentation)
{name: 'username', label: 'Username', required: true, autoCapitalize: "none", autoCorrect: false},
Sorry, I'm really trying to help here.
@lucj You are not defining the fields properly for email type, please take a look at the documentation.
@MosesEsan ok, really sorry for that last part, it seems I did something wrong on my side :( Are you fine with the PR then ?
(BTW, thanks this project is really neat !)
Add maxLength to TextInput