'keyboard closes on textinput focus in android 10 devices
I have a simple textinput but i cant type as the keyboard closes as soon as focus in TextInput:
import React, { useContext, useState } from 'react';
import { TextInput } from 'react-native';
import { Button } from 'react-native-paper';
const SearchBar = (props) => {
const [searchQuery, setSearchQuery] = useState('');
const [loading, setLoading] = useState(false);
const { searchBy } = props;
const { navigation } = props;
const { params } = props.route;
const onChangeSearch = (query) => setSearchQuery(query);
const doSeach = async () => {
setLoading(true);
const bundlesFound = await Service.search(searchQuery.trim());
//do stuff.
setLoading(false);
};
return (
<>
<TextInput
onChangeText={onChangeSearch}
onSubmitEditing={doSeach}
value={searchQuery}
/>
<Button
icon="magnify"
loading={loading}
mode="contained"
compact
onPress={doSeach}
/>
</>
);
};
export default SearchBar;
As soon as I focus the textinput, the keyboard opens but it closes down immediately on android 10 devices mainly.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
