From cee04984a5a5415ab2c0b03e4aff7c7a160e74b6 Mon Sep 17 00:00:00 2001 From: Godefroy Ponsinet Date: Thu, 20 Sep 2018 15:45:52 +0200 Subject: [PATCH] fix(rn): android paste publickey Signed-off-by: Godefroy Ponsinet --- .../Screens/Contacts/Add/ByPublicKey.js | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/client/react-native/common/components/Screens/Contacts/Add/ByPublicKey.js b/client/react-native/common/components/Screens/Contacts/Add/ByPublicKey.js index ffea504c44..1d1992b138 100644 --- a/client/react-native/common/components/Screens/Contacts/Add/ByPublicKey.js +++ b/client/react-native/common/components/Screens/Contacts/Add/ByPublicKey.js @@ -1,5 +1,5 @@ import React, { PureComponent } from 'react' -import { TextInput } from 'react-native' +import { TextInput as TextInputNative } from 'react-native' import { Flex, Screen, Button } from '../../../Library' import { colors } from '../../../../constants' import { @@ -13,6 +13,31 @@ import { import { mutations } from '../../../../graphql' import createTabNavigator from 'react-navigation-deprecated-tab-navigator/src/createTabNavigator' +class TextInputMultilineFix extends PureComponent { + state = { + multiline: true, + } + + render () { + return ( + + this.setState({ multiline: false }, () => + this.setState({ multiline: true }) + ) + } + onBlur={() => + this.setState({ multiline: false }, () => + this.setState({ multiline: true }) + ) + } + multiline={this.state.multiline} + {...this.props} + /> + ) + } +} + class ByPublicKey extends PureComponent { state = { contactID: '', @@ -29,20 +54,20 @@ class ByPublicKey extends PureComponent { return ( - this.setState({ contactID }) : undefined } + selectTextOnFocus /> {routeName === 'Enter a public key' && (