New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inputValue always lags behind 1 #36
Comments
Should be the current value. Let me check |
return (
<GoogleAutoComplete
apiKey={GOOGLE_API_KEY_PLACES}
debounce={300}
minLength={data.maxTextSearchLength}
components={`country:${country.toLowerCase()}`}
radius={`${radius}`}
lat={location.latitude}
lng={location.longitude}
queryTypes={''}
>
{({ inputValue, handleTextChange, locationResults, fetchDetails, isSearching }) => (
<View
style={{ ...styles.container, ...style }}>
<React.Fragment>
<View style={{ ...styles.textInputContainer, height: insets.top + 30 }}>
<Searchbar
placeholder='Find your destination'
onChangeText={props => { handleTextChange(props); onSearchingUpdate(inputValue, isSearching); console.log(`inputValue: ${inputValue}`); }}
value={inputValue}
icon={isSearching ? () => (<ActivityIndicator animating={true} color={Colors.blueA700} />) : () => (<MaterialIcons name={iconName ? iconName : 'search'} size={24} color={iconColor ? iconColor : theme.colors.black} />)}
onIconPress={isSearching ? null : onIconPress}
onFocus={onFocus}
/>
</View>
{
handleSearchingUpdate(inputValue, locationResults) && locationResults.length
?
<ScrollView
style={styles.listView}
keyboardShouldPersistTaps='handled'
>
<List.Section>
{locationResults.map((el, i) => (
<LocationItem
{...el}
fetchDetails={fetchDetails}
key={String(i)}
/>
))}
</List.Section>
</ScrollView>
:
null
}
</React.Fragment>
</View>
)}
</GoogleAutoComplete>
);
}; Or am I doing something wrong? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can this be corrected? The passed argument is always the last value and not the current value.
The text was updated successfully, but these errors were encountered: