minor search screen ux improvements (#2264)
* handle taps while keyboard is displayed * dismiss keyboard on drag when searching feeds * dismiss on drag and persist taps on suggested follows * add hitslop to clear button * add hitslop to cancel button * dismiss keyboard on drag when searching users * hit slop for feed search clear button * move importzio/stable
parent
40a110c541
commit
f0532865ce
|
@ -11,6 +11,7 @@ import {
|
||||||
FontAwesomeIcon,
|
FontAwesomeIcon,
|
||||||
FontAwesomeIconStyle,
|
FontAwesomeIconStyle,
|
||||||
} from '@fortawesome/react-native-fontawesome'
|
} from '@fortawesome/react-native-fontawesome'
|
||||||
|
import {HITSLOP_10} from 'lib/constants'
|
||||||
import {MagnifyingGlassIcon} from 'lib/icons'
|
import {MagnifyingGlassIcon} from 'lib/icons'
|
||||||
import {useTheme} from 'lib/ThemeContext'
|
import {useTheme} from 'lib/ThemeContext'
|
||||||
import {usePalette} from 'lib/hooks/usePalette'
|
import {usePalette} from 'lib/hooks/usePalette'
|
||||||
|
@ -71,7 +72,8 @@ export function SearchInput({
|
||||||
onPress={onPressCancelSearchInner}
|
onPress={onPressCancelSearchInner}
|
||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
accessibilityLabel={_(msg`Clear search query`)}
|
accessibilityLabel={_(msg`Clear search query`)}
|
||||||
accessibilityHint="">
|
accessibilityHint=""
|
||||||
|
hitSlop={HITSLOP_10}>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon="xmark"
|
icon="xmark"
|
||||||
size={16}
|
size={16}
|
||||||
|
|
|
@ -494,6 +494,8 @@ export function FeedsScreen(_props: Props) {
|
||||||
// @ts-ignore our .web version only -prf
|
// @ts-ignore our .web version only -prf
|
||||||
desktopFixedHeight
|
desktopFixedHeight
|
||||||
scrollIndicatorInsets={{right: 1}}
|
scrollIndicatorInsets={{right: 1}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
keyboardDismissMode="on-drag"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{hasSession && (
|
{hasSession && (
|
||||||
|
|
|
@ -162,6 +162,8 @@ function SearchScreenSuggestedFollows() {
|
||||||
// @ts-ignore web only -prf
|
// @ts-ignore web only -prf
|
||||||
desktopFixedHeight
|
desktopFixedHeight
|
||||||
contentContainerStyle={{paddingBottom: 1200}}
|
contentContainerStyle={{paddingBottom: 1200}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
keyboardDismissMode="on-drag"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<CenteredView sideBorders style={[pal.border, s.hContentRegion]}>
|
<CenteredView sideBorders style={[pal.border, s.hContentRegion]}>
|
||||||
|
@ -572,7 +574,8 @@ export function SearchScreenMobile(
|
||||||
onPress={onPressClearQuery}
|
onPress={onPressClearQuery}
|
||||||
accessibilityRole="button"
|
accessibilityRole="button"
|
||||||
accessibilityLabel={_(msg`Clear search query`)}
|
accessibilityLabel={_(msg`Clear search query`)}
|
||||||
accessibilityHint="">
|
accessibilityHint=""
|
||||||
|
hitSlop={HITSLOP_10}>
|
||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
icon="xmark"
|
icon="xmark"
|
||||||
size={16}
|
size={16}
|
||||||
|
@ -584,7 +587,10 @@ export function SearchScreenMobile(
|
||||||
|
|
||||||
{query || inputIsFocused ? (
|
{query || inputIsFocused ? (
|
||||||
<View style={styles.headerCancelBtn}>
|
<View style={styles.headerCancelBtn}>
|
||||||
<Pressable onPress={onPressCancelSearch} accessibilityRole="button">
|
<Pressable
|
||||||
|
onPress={onPressCancelSearch}
|
||||||
|
accessibilityRole="button"
|
||||||
|
hitSlop={HITSLOP_10}>
|
||||||
<Text style={[pal.text]}>
|
<Text style={[pal.text]}>
|
||||||
<Trans>Cancel</Trans>
|
<Trans>Cancel</Trans>
|
||||||
</Text>
|
</Text>
|
||||||
|
@ -598,7 +604,10 @@ export function SearchScreenMobile(
|
||||||
{isFetching ? (
|
{isFetching ? (
|
||||||
<Loader />
|
<Loader />
|
||||||
) : (
|
) : (
|
||||||
<ScrollView style={{height: '100%'}}>
|
<ScrollView
|
||||||
|
style={{height: '100%'}}
|
||||||
|
keyboardShouldPersistTaps="handled"
|
||||||
|
keyboardDismissMode="on-drag">
|
||||||
{searchResults.length ? (
|
{searchResults.length ? (
|
||||||
searchResults.map((item, i) => (
|
searchResults.map((item, i) => (
|
||||||
<SearchResultCard
|
<SearchResultCard
|
||||||
|
|
Loading…
Reference in New Issue