Apply flex style only to empty results (#4728) (#4729)

(cherry picked from commit ffb5213b3a)

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
This commit is contained in:
Mattermost Build 2020-08-25 19:12:24 -04:00 committed by GitHub
parent a47b2a3831
commit 449d7272d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -8,7 +8,7 @@ exports[`components/emoji_picker/emoji_picker.ios should match snapshot 1`] = `
<KeyboardAvoidingView
behavior="padding"
enabled={false}
keyboardVerticalOffset={50}
keyboardVerticalOffset={80}
style={
Object {
"flex": 1,

View file

@ -25,7 +25,7 @@ export default class EmojiPicker extends EmojiPickerBase {
const shorten = DeviceTypes.IS_IPHONE_WITH_INSETS && isLandscape ? 6 : 2;
let keyboardOffset = DeviceTypes.IS_IPHONE_WITH_INSETS ? 50 : 30;
let keyboardOffset = DeviceTypes.IS_IPHONE_WITH_INSETS ? 80 : 60;
if (isLandscape) {
keyboardOffset = DeviceTypes.IS_IPHONE_WITH_INSETS ? 0 : 10;
}

View file

@ -251,6 +251,8 @@ export default class EmojiPicker extends PureComponent {
let listComponent;
if (searchTerm) {
const contentContainerStyle = filteredEmojis.length ? null : styles.flex;
listComponent = (
<FlatList
data={filteredEmojis}
@ -261,7 +263,7 @@ export default class EmojiPicker extends PureComponent {
pageSize={10}
renderItem={this.flatListRenderItem}
ListEmptyComponent={this.renderEmptyList}
contentContainerStyle={styles.flex}
contentContainerStyle={contentContainerStyle}
style={styles.flatList}
/>
);