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
TextInput with editable set to false does not emit OnPressIn and OnPressOut #33649
Comments
Setting it to falsy value will work on both Android and iOS. In above snack link |
Encountered same problem |
This worked for me on both Android and iOS |
This works for me too! |
Have the same problem. Setting it to null for Android makes the input editable and ignores any autofocus of subsequent form field rendering |
apart from using editable={null} I also added onFocus={() => Keyboard.dismiss(), as android was pulling up keyboard and still focusing that input update: apparently there is a better way using: |
I found a solution to trigger a function on pressing the TextInput with editable set to false for both iOS and android.
|
This works like a charm! Thx u saved my day |
Setting I'm not familiar with the source code of React Native, but I think this is the line that confirms this:
Until this issue is fixed, the workaround of wrapping your input with some sort of Pressable is the only valid option to achieve this functionality. |
this saved the day |
This one works like a charm, Thanks 🙇 |
Description
Having
TextInput
component witheditable
prop set tofalse
has different effect on iOS and Android.On iOS
OnPressIn
andOnPressOut
are emitted correctly, but on Android they're not triggered.Version
0.68.1
Output of
npx react-native info
It's clearly visible on snack, no need for my workspace configuration
Steps to reproduce
TextInput
componenteditable
prop to falseOnPressIn
callbackOnPressIn
on AndroidSnack, code example, screenshot, or link to a repository
https://snack.expo.dev/@michal.maka/textinput-editable-android
The text was updated successfully, but these errors were encountered: