mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-06-20 21:48:42 -04:00
committed by
GitHub
parent
86054225d2
commit
b841d0018d
@@ -9,7 +9,7 @@ import {
|
||||
import { View } from "components/styledComponents";
|
||||
import type { Node } from "react";
|
||||
import React, {
|
||||
useCallback, useLayoutEffect, useRef, useState
|
||||
useCallback, useState
|
||||
} from "react";
|
||||
import { FlatList } from "react-native";
|
||||
import { useIconicTaxa } from "sharedHooks";
|
||||
@@ -24,12 +24,6 @@ const DROP_SHADOW = getShadowForColor( colors.darkGray, {
|
||||
const ExploreTaxonSearch = ( ): Node => {
|
||||
const [taxonQuery, setTaxonQuery] = useState( "" );
|
||||
const navigation = useNavigation( );
|
||||
// Ref for the input field
|
||||
const inputRef = useRef( null );
|
||||
// Focus input field on mount
|
||||
useLayoutEffect( ( ) => {
|
||||
inputRef.current?.focus();
|
||||
}, [] );
|
||||
|
||||
const iconicTaxa = useIconicTaxa( { reload: false } );
|
||||
const taxonList = useTaxonSearch( taxonQuery );
|
||||
@@ -63,7 +57,6 @@ const ExploreTaxonSearch = ( ): Node => {
|
||||
handleTextChange={setTaxonQuery}
|
||||
value={taxonQuery}
|
||||
testID="SearchTaxon"
|
||||
input={inputRef}
|
||||
/>
|
||||
</View>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ type Props = {
|
||||
// Ensure this component is placed outside of scroll views
|
||||
|
||||
const SearchBar = ( {
|
||||
autoFocus = false,
|
||||
autoFocus = true,
|
||||
clearSearch,
|
||||
containerClass,
|
||||
handleTextChange,
|
||||
|
||||
Reference in New Issue
Block a user