Add searchbar autofocus
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -41,10 +41,12 @@ const memesHeaderStyles = StyleSheet.create({
|
||||
const MemesHeader = ({
|
||||
search,
|
||||
setSearch,
|
||||
autoFocus,
|
||||
...props
|
||||
}: {
|
||||
search: string;
|
||||
setSearch: (search: string) => void;
|
||||
autoFocus: boolean;
|
||||
} & ComponentProps<typeof View>) => {
|
||||
const { colors } = useTheme();
|
||||
const sort = useSelector((state: RootState) => state.memes.sort);
|
||||
@@ -86,6 +88,7 @@ const MemesHeader = ({
|
||||
placeholder="Search Memes"
|
||||
value={search}
|
||||
onChangeText={setSearch}
|
||||
autoFocus={autoFocus}
|
||||
/>
|
||||
<View style={memesHeaderStyles.buttonView}>
|
||||
<View style={memesHeaderStyles.buttonSection}>
|
||||
|
Reference in New Issue
Block a user