react-native-form-generator
react-native-form-generator copied to clipboard
Android TextInput doesn't display its UI
Hi, it's mostly a heads-up, since you're working on a new version.
I had opened this issue (https://github.com/facebook/react-native/issues/9862) on RN, but after isolating the issue, I found out it is a form-generator issue.
I commented InputComponent.js so that handleLayoutChange and handleLabelLayoutChange are no-ops.
I'm not sure about the implications, but it's working fine in my Android app so far.
handleLayoutChange(e){
// let {x, y, width, height} = {... e.nativeEvent.layout};
//
// this.setState(e.nativeEvent.layout);
// //e.nativeEvent.layout: {x, y, width, height}}}.
}
handleLabelLayoutChange(e){
// let {x, y, width, height} = {... e.nativeEvent.layout};
//
// this.setState({labelWidth:width});
// //e.nativeEvent.layout: {x, y, width, height}}}.
}
Had to change the code, because iOS wants the layout changes.
So it would be more like
handleLayoutChange(e){
if (Platform.OS === 'ios') {
let {x, y, width, height} = {... e.nativeEvent.layout};
this.setState(e.nativeEvent.layout);
}
// //e.nativeEvent.layout: {x, y, width, height}}}.
}
handleLabelLayoutChange(e){
if (Platform.OS === 'ios') {
let {x, y, width, height} = {... e.nativeEvent.layout};
this.setState({labelWidth:width});
}
// //e.nativeEvent.layout: {x, y, width, height}}}.
}
I'm going to investigate
I just realized it's the same problem of my report, you can check it for further details: #68