react-native-form-generator icon indicating copy to clipboard operation
react-native-form-generator copied to clipboard

Android TextInput doesn't display its UI

Open jbrodriguez opened this issue 9 years ago • 3 comments
trafficstars

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}}}.
  }

jbrodriguez avatar Sep 14 '16 14:09 jbrodriguez

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}}}.
  }

jbrodriguez avatar Sep 14 '16 18:09 jbrodriguez

I'm going to investigate

MichaelCereda avatar Sep 21 '16 15:09 MichaelCereda

I just realized it's the same problem of my report, you can check it for further details: #68

gmlion avatar Oct 12 '16 14:10 gmlion