react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Bug : TextInput focus bug

Open Arjun059 opened this issue 1 year ago • 2 comments

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",

Arjun059 avatar Mar 09 '24 08:03 Arjun059

Faced with the same issue on Android/iOS. onPress action doesn't work if iconButton was pressed, only keyboard hides and textinput looses focus.

donutdonate avatar Mar 12 '24 15:03 donutdonate

@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.

donutdonate avatar Mar 13 '24 09:03 donutdonate

Thank you @donutdonate it's working

Arjun059 avatar May 21 '24 11:05 Arjun059