mirror of
https://github.com/tooot-app/app
synced 2025-01-27 08:51:26 +01:00
Make search transition smoother?
This commit is contained in:
parent
a5315501fd
commit
b76d3f50df
@ -49,7 +49,6 @@ const TabSharedSearch: React.FC<TabSharedStackScreenProps<'Tab-Shared-Search'>>
|
|||||||
<TextInput
|
<TextInput
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
accessibilityRole='search'
|
accessibilityRole='search'
|
||||||
keyboardAppearance={mode}
|
|
||||||
style={{
|
style={{
|
||||||
fontSize: StyleConstants.Font.Size.M,
|
fontSize: StyleConstants.Font.Size.M,
|
||||||
flex: 1,
|
flex: 1,
|
||||||
@ -60,7 +59,6 @@ const TabSharedSearch: React.FC<TabSharedStackScreenProps<'Tab-Shared-Search'>>
|
|||||||
borderBottomColor: colors.border,
|
borderBottomColor: colors.border,
|
||||||
borderBottomWidth: 1
|
borderBottomWidth: 1
|
||||||
}}
|
}}
|
||||||
autoFocus
|
|
||||||
onChangeText={debounce(
|
onChangeText={debounce(
|
||||||
text => {
|
text => {
|
||||||
setSearchTerm(text)
|
setSearchTerm(text)
|
||||||
@ -82,6 +80,13 @@ const TabSharedSearch: React.FC<TabSharedStackScreenProps<'Tab-Shared-Search'>>
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, [mode])
|
}, [mode])
|
||||||
|
useEffect(() => {
|
||||||
|
const unsubscribe = navigation.addListener('transitionEnd', e => {
|
||||||
|
inputRef.current?.focus()
|
||||||
|
})
|
||||||
|
|
||||||
|
return unsubscribe
|
||||||
|
}, [navigation])
|
||||||
|
|
||||||
const mapKeyToTranslations = {
|
const mapKeyToTranslations = {
|
||||||
accounts: t('shared.search.sections.accounts'),
|
accounts: t('shared.search.sections.accounts'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user