You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to return to my initial list of items on my main page I use
router.push("/main") which cancels the search, unfocuses and clears all search results. My problem is now, that the search bar is not showing on the initial render after navigation, the user has to scroll in order make it visible again. Any ideas why and how to fix it? On all other navigation usecases it is shown on initial render. Since expo is built on top of react navigation maybe somebody knows the answer in this forum.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi community,
I have a searchbar on my main page for searching and adding items. It is integrated via
import { useNavigation } from "expo-router"
const navigation = useNavigation()
useLayoutEffect(() => {
navigation.setOptions({
headerSearchBarOptions: {
placeholder: "Search and add bike",
onChangeText: (event) => handleInputChange(event.nativeEvent.text),
onFocus: (event) => setIsSearchbarFocused(true),
onBlur: (event) => setIsSearchbarFocused(false),
},
})
}, [navigation])
In order to return to my initial list of items on my main page I use
router.push("/main") which cancels the search, unfocuses and clears all search results. My problem is now, that the search bar is not showing on the initial render after navigation, the user has to scroll in order make it visible again. Any ideas why and how to fix it? On all other navigation usecases it is shown on initial render. Since expo is built on top of react navigation maybe somebody knows the answer in this forum.
Thanks in advance
Regards
Mati
Beta Was this translation helpful? Give feedback.
All reactions