This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

react-native-textinput-autoheight

1.0.2 • Public • Published

React Native Auto-height

Install:

$ npm i react-native-textinput-autoheight --save

Exampe:

import AutoheightTextInput from 'react-native-textinput-autoheight';

<AutoheightTextInput
    value={this.state.text}
    onChangeText={ this._onChangeText.bind(this) }
/>

_onChangeText(text){
    this.setState({ text });
}

You can use all PropTypes of TextInput.

Newline hook

import AutoheightTextInput from 'react-native-textinput-autoheight';

<AutoheightTextInput
    value={this.state.text}
    onChangeText={ this._onChangeText.bind(this) }
    onSubmitEditing={ this._onSubmitEditing.bind(this) }
    blurOnSubmit={ false }
/<

_onSubmitEditing(){
    if (!this.state.text.endsWith("\n")) {
        let text = this.state.text;
        text = text + "\n";
        this.setState({ text });
    }
}

_onChangeText(text){
    this.setState({ text });
}

Package Sidebar

Install

npm i react-native-textinput-autoheight

Weekly Downloads

2

Version

1.0.2

License

ISC

Last publish

Collaborators

  • krzystof