Skip to content
Commits on Source (2)
......@@ -30,7 +30,7 @@ exports[`cature poster component should renders correctly 1`] = `
>
<TextInput
allowFontScaling={true}
editable={true}
editable={false}
multiline={true}
onChangeText={[Function]}
onSelectionChange={[Function]}
......
......@@ -3,7 +3,6 @@ import {
StyleSheet,
View,
ScrollView,
TextInput,
Text,
Alert,
Button,
......@@ -39,6 +38,9 @@ import logService from '../common/services/log.service';
import i18n from '../common/services/i18n.service';
import settingsStore from '../settings/SettingsStore';
// workaround for android copy/paste
import TextInput from '../common/components/TextInput';
@inject('user', 'capture')
@observer
export default class CapturePoster extends Component {
......
import React, { Component } from 'react';
import { TextInput } from 'react-native';
/**
* Workaround for copy/paste issue on android
* https://github.com/facebook/react-native/issues/20887
*/
export default class AlternativeTextInput extends React.Component<Props, State> {
static defaultProps = {
editable: true,
}
constructor(props) {
super(props);
this.state = {
editable: !props.editable
};
}
componentDidMount() {
if (this.props.editable) {
setTimeout(() => {
this.setState({ editable: true });
}, 100);
}
}
render() {
const { editable } = this.state;
return <TextInput {...this.props} editable={editable} />;
}
}
\ No newline at end of file