I read the full discussion in #14045 and it seems to have been auto-closed without sufficient resolution. It would be great if we could have sufficient resolution of this issue without it being prematurely closed.
The issue here is that there is no way to disable the keyboard from popping up on a text input field while still allowing the user to paste into the field, which works for both iOS and Android.
editable={false} then you can't paste into it so that doesn't work as a solution.onFocus={() => Keyboard.dismiss()} is not acceptable because the keyboard pops up for a second (both iOS and Android) so this can't be used.showSoftInputOnFocus does exactly what is wanted but it only works for Android. (Side note: it seems this prop isn't included in the latest typings in 0.61.4, so there is a typescript error even though the prop works)How can we make this work sufficiently for both iOS and Android?
React Native version:
System:
OS: Linux 4.15 Ubuntu 18.04.3 LTS (Bionic Beaver)
CPU: (8) x64 Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
Memory: 3.75 GB / 61.90 GB
Shell: 5.4.2 - /bin/zsh
Binaries:
Node: 12.13.0 - /usr/bin/node
Yarn: 1.19.1 - /usr/bin/yarn
npm: 6.12.0 - /usr/bin/npm
SDKs:
Android SDK:
API Levels: 23, 26, 28, 29
Build Tools: 23.0.1, 25.0.0, 28.0.3, 29.0.0, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.4 => 0.61.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native: 0.61.2
<TextInput /> componentDescribe what you expected to happen:
There should be some way we can make iOS and Android behave the same for this.
Sample code:
<TextInput
onFocus={() => Keyboard.dismiss()}
autoFocus={true}
showSoftInputOnFocus={false}
placeholder={"Some sample text"}
/>
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
@stale fuck off stale bot. No one ever looked at this, but otherwise nothing is stale about this
If you want to hide the keyboard for a TextInput (for something like creating your own keyboard component), don't use a TextInput. Use Text instead. If you have multiple components that need input, wrap them in Touchables. You can then manage which one is 'editable' through the onPress of each Touchable.
@nickmccomb Using Text instead of TextInput will prevent external keyboard usage.
I'm making a barcode scanner app and need the keyboard to hide when an input is pressed :(
Will be awesome to have the showSoftInputOnFocus props on iOS
If you want to hide the keyboard for a TextInput (for something like creating your own keyboard component), don't use a TextInput. Use Text instead. If you have multiple components that need input, wrap them in Touchables. You can then manage which one is 'editable' through the onPress of each Touchable.
I've read this over several times thinking that i was missing something. I see no way to reasonably make and place a touchable cursor.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
@stale keep walking bro, nothing to see here
PD: I really need this feature
the most wanted feature for years! really nothing can be done?
Most helpful comment
@stale fuck off stale bot. No one ever looked at this, but otherwise nothing is stale about this