mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-04-24 04:25:27 +08:00
38 lines
791 B
JavaScript
38 lines
791 B
JavaScript
/**
|
|
* @flow
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { styles as helperStyles } from '../helpers';
|
|
import { StyleSheet, TextInput, TouchableWithoutFeedback, View } from 'react-native';
|
|
|
|
export default class TouchableWrapper extends React.Component {
|
|
render() {
|
|
return (
|
|
<TouchableWithoutFeedback onPress={this._handlePress}>
|
|
<View style={styles.container}>
|
|
<TextInput multiline={false} ref={this._setRef} style={helperStyles.textinput} />
|
|
</View>
|
|
</TouchableWithoutFeedback>
|
|
);
|
|
}
|
|
|
|
_handlePress = () => {
|
|
if (this._input) {
|
|
this._input.focus();
|
|
}
|
|
};
|
|
|
|
_setRef = c => {
|
|
this._input = c;
|
|
};
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
container: {
|
|
flexDirection: 'row',
|
|
alignItems: 'center',
|
|
padding: 50
|
|
}
|
|
});
|