* Fix keyboard overlap recent search item in search tab
* Set the behavior of KeyboardAvoidingView on Android to 'undefined' to avoid losing some content at the bottom
(cherry picked from commit 79994bf159)
Co-authored-by: namanh-asher <namanhmhn@gmail.com>
This commit is contained in:
parent
4e3cf72b4d
commit
885ae2c29f
1 changed files with 17 additions and 12 deletions
|
|
@ -4,7 +4,7 @@
|
|||
import {useIsFocused, useNavigation} from '@react-navigation/native';
|
||||
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
|
||||
import {useIntl} from 'react-intl';
|
||||
import {FlatList, type LayoutChangeEvent, Platform, StyleSheet, type ViewStyle} from 'react-native';
|
||||
import {FlatList, type LayoutChangeEvent, Platform, StyleSheet, type ViewStyle, KeyboardAvoidingView} from 'react-native';
|
||||
import HWKeyboardEvent from 'react-native-hw-keyboard-event';
|
||||
import Animated, {useAnimatedStyle, useDerivedValue, withTiming} from 'react-native-reanimated';
|
||||
import {type Edge, SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context';
|
||||
|
|
@ -363,10 +363,14 @@ const SearchScreen = ({teamId, teams}: Props) => {
|
|||
onLayout={onLayout}
|
||||
testID='search_messages.screen'
|
||||
>
|
||||
<Animated.View style={animated}>
|
||||
<Animated.View style={headerTopStyle}>
|
||||
<RoundedHeaderContext/>
|
||||
{lastSearchedValue && !loading &&
|
||||
<KeyboardAvoidingView
|
||||
style={styles.flex}
|
||||
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||
>
|
||||
<Animated.View style={animated}>
|
||||
<Animated.View style={headerTopStyle}>
|
||||
<RoundedHeaderContext/>
|
||||
{lastSearchedValue && !loading &&
|
||||
<Header
|
||||
teamId={searchTeamId}
|
||||
setTeamId={handleResultsTeamChange}
|
||||
|
|
@ -376,9 +380,9 @@ const SearchScreen = ({teamId, teams}: Props) => {
|
|||
selectedFilter={filter}
|
||||
teams={teams}
|
||||
/>
|
||||
}
|
||||
</Animated.View>
|
||||
{!showResults &&
|
||||
}
|
||||
</Animated.View>
|
||||
{!showResults &&
|
||||
<AnimatedFlatList
|
||||
onLayout={onFlatLayout}
|
||||
data={dummyData}
|
||||
|
|
@ -395,8 +399,8 @@ const SearchScreen = ({teamId, teams}: Props) => {
|
|||
ref={scrollRef}
|
||||
renderItem={renderInitialOrLoadingItem}
|
||||
/>
|
||||
}
|
||||
{showResults && !loading &&
|
||||
}
|
||||
{showResults && !loading &&
|
||||
<Results
|
||||
loading={resultsLoading}
|
||||
selectedTab={selectedTab}
|
||||
|
|
@ -407,8 +411,9 @@ const SearchScreen = ({teamId, teams}: Props) => {
|
|||
scrollPaddingTop={lockValue.value}
|
||||
fileChannelIds={fileChannelIds}
|
||||
/>
|
||||
}
|
||||
</Animated.View>
|
||||
}
|
||||
</Animated.View>
|
||||
</KeyboardAvoidingView>
|
||||
</SafeAreaView>
|
||||
{searchIsFocused &&
|
||||
<Autocomplete
|
||||
|
|
|
|||
Loading…
Reference in a new issue