Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import { TextInput } from 'react-native';
- import selectable from './selectable';
- const Selectable = selectable(TextInput); // The most important line in this implementation!
- export default class SelectableInput extends Component {
- _input: any
- _handleInputPress = () => {
- this._input.focus();
- }
- handleSubmit = () => {
- this._input.blur();
- }
- render() {
- return (
- <Selectable
- onPress={this._handleInputPress}
- onSubmitEditing={this.handleSubmit}
- ref={i => (this._input = i ? i._wrappedComponent : null)}
- {...this.props}
- />
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement