From 0a7b297a6f5fa3b4ec4708f027258cf6d95d51b6 Mon Sep 17 00:00:00 2001 From: enahum Date: Thu, 28 Sep 2017 11:17:58 -0300 Subject: [PATCH] Fix android search autocomplete (#958) --- app/components/autocomplete/index.js | 47 +++++++++++++++------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/app/components/autocomplete/index.js b/app/components/autocomplete/index.js index 8ac804e89..7619475c3 100644 --- a/app/components/autocomplete/index.js +++ b/app/components/autocomplete/index.js @@ -1,7 +1,7 @@ // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import React, {Component} from 'react'; +import React, {PureComponent} from 'react'; import PropTypes from 'prop-types'; import { StyleSheet, @@ -12,27 +12,7 @@ import AtMention from './at_mention'; import ChannelMention from './channel_mention'; import EmojiSuggestion from './emoji_suggestion'; -const style = StyleSheet.create({ - container: { - position: 'absolute', - bottom: 0, - left: 0, - right: 0, - maxHeight: 200, - overflow: 'hidden' - }, - searchContainer: { - position: 'absolute', - top: 0, - left: 0, - right: 0, - maxHeight: 300, - overflow: 'hidden', - zIndex: 5 - } -}); - -export default class Autocomplete extends Component { +export default class Autocomplete extends PureComponent { static propTypes = { onChangeText: PropTypes.func.isRequired, rootId: PropTypes.string, @@ -75,3 +55,26 @@ export default class Autocomplete extends Component { ); } } + +const style = StyleSheet.create({ + container: { + position: 'absolute', + bottom: 0, + left: 0, + right: 0, + maxHeight: 200, + overflow: 'hidden' + }, + searchContainer: { + backgroundColor: 'white', + elevation: 5, + flex: 1, + position: 'absolute', + top: 0, + left: 0, + right: 0, + maxHeight: 250, + overflow: 'hidden', + zIndex: 5 + } +});