Bug : TextInput focus bug
Current behaviour
code import * as React from 'react'; import { TextInput } from 'react-native-paper';
const MyComponent = () => { const [text, setText] = React.useState('');
return ( <TextInput label="Password" secureTextEntry right={<TextInput.Icon icon="eye" />} /> ); };
export default MyComponent;
issue: when click eye icon keyboard disappear and TextInput loosed focus.
Expected behaviour
expected behaviour when i click eye icon the TextInput remain Fucused. Like i want to input password the eye icon toggle security text true or false and TextInput should remain Focused
Preview
What have you tried so far?
Your Environment
Test in android 12
package versions "react-native-paper": "^5.10.6", "react": "18.2.0",
Faced with the same issue on Android/iOS. onPress action doesn't work if iconButton was pressed, only keyboard hides and textinput looses focus.
@Arjun059 Hi! In my case the problem was with ScrollView settings. If you use ScrollView set the keyboardShouldPersistTaps prop to "handled", so the keyboard will not dismiss automatically when the tap was handled by children of the ScrollView.
Thank you @donutdonate it's working