halilb / react-native-textinput-effects

Text inputs with custom label and icon animations for iOS and android. Built with react native and inspired by Codrops.
MIT License
2.99k stars 293 forks source link

Cann't focus input with the label if the input is not editable #38

Closed mickaelwegerich closed 7 years ago

mickaelwegerich commented 7 years ago

I notice if I use the props editable={false} of TextInput to put it in read only mode. But I can focus the field if I click on the label because in the code there is: <TouchableWithoutFeedback onPress={this.focus}>

So I fix the bug for the moment like this in the BaseInput class:

focus() {
      if(!this.props.editable)
          return
    this.inputRef().focus();
  }
halilb commented 7 years ago

Thanks for reporting @mickaelw.

Are you using the latest version of the library? This problem should be fixed in 0.3.1, using the same solution you've proposed. You can checkout #30 for more info.

Closing the issue but you're welcome to re-open if there's any other problem I'm missing.

mickaelwegerich commented 7 years ago

OK thank you, I update the module soon