Hi, I am currently having a trouble with the default behavior of the library for t.String items
When typing in the textInput and reaching the end of the visible zone, the visible view should scroll to show what the user is tipping.
When typing in the textInput and reaching the end of the visible zone, the user can still type but he can't see what he is typing after that point.
I reproduced it with my own project, and also just using the example simple project (https://github.com/gcanti/tcomb-form-native#example)
I am using a stackNavigator around it but I don't think It may change anything in this case.
No error or stack trace is launched
Using my project :
var Email = t.refinement(t.String, function (n) {
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
return n.match(emailRegex) ? true : false;
});
var Login = t.struct({
login: Email,
password: t.String,
});
var loginOptions = {
auto: 'placeholders',
fields: {
login: {
error: 'Identifiant incorrect',
autoCapitalize: "none",
autoCorrect: false,
underlineColorAndroid: 'transparent',
placeholder: 'Identifiant',
keyboardType: 'email-address',
blurOnSubmit: true
},
password: {
error: 'Mot de passe incorrect',
autoCapitalize: "none",
autoCorrect: false,
secureTextEntry: true,
underlineColorAndroid: 'transparent',
placeholder: 'Mot de passe',
blurOnSubmit: true,
}
}
};
<Form
ref="form"
type={Login}
options={loginOptions} />
After looking into the style of the library I found out the problem in the ROOT_PROJECT/node_modules/tcomb-form-native/lib/stylesheets/bootstrap.js
textbox: {
normal: {
color: INPUT_COLOR,
fontSize: FONT_SIZE,
//height: 36,
paddingVertical: (Platform.OS === 'ios') ? 7 : 0,
paddingHorizontal: 7,
borderRadius: 4,
borderColor: BORDER_COLOR,
borderWidth: 1,
marginBottom: 5
},
// the style applied when a validation error occours
error: {
color: INPUT_COLOR,
fontSize: FONT_SIZE,
//height: 36,
paddingVertical: (Platform.OS === 'ios') ? 7 : 0,
paddingHorizontal: 7,
borderRadius: 4,
borderColor: ERROR_COLOR,
borderWidth: 1,
marginBottom: 5
},
// the style applied when the textbox is not editable
notEditable: {
fontSize: FONT_SIZE,
//height: 36,
paddingVertical: (Platform.OS === 'ios') ? 7 : 0,
paddingHorizontal: 7,
borderRadius: 4,
borderColor: BORDER_COLOR,
borderWidth: 1,
marginBottom: 5,
color: DISABLED_COLOR,
backgroundColor: DISABLED_BACKGROUND_COLOR
}
},
The height:36 block the ui, removing it makes it works
That works! What in the world does height have to do with horizontal scrolling!?!?!?!
Most helpful comment
After looking into the style of the library I found out the problem in the ROOT_PROJECT/node_modules/tcomb-form-native/lib/stylesheets/bootstrap.js
The height:36 block the ui, removing it makes it works