I'm trying to build a react native app that receives input from a bluetooth barcode scanner which basically just acts as keyboard emulation. I'm receiving the input into a TextInput however I don't want to show the keyboard. However, if I dismiss the keyboard it doesn't accept input into the TextInput.
Is there any way to accept input from the barcode scanner without showing the keyboard?
I know this is an old question, but,
There is a property called showSoftInputOnFocus in newer react-native versions. Setting this to false keeps the keyboard hidden.
Working for me on v0.60.0
React-Native TextInput with focus but without keyboard showing
Related
I created a modal using react-native-modalfy(because of its universal usage) that has an input field. On android everything is working as expected(i.e., modal moving up when keyboard aperars) but on the iOS, whenever I try to type something the keyboard appears on the modal UI and doesn't allow me to see anything that happens on the modal UI. Is there any workaround to get past this issue?enter image description here
I'm building my own soft keyboard for my app.
I was wondering if there was a way of popping open my custom keyboard instead of the default android soft Keyboard.
For example, when clicking on a TextField, I would like my custom keyboard to be the input source.
trying to build an OTP input screen. From what I read, it can be achieved by hiding the TextInput component and displaying the inputted text in views. I have shared a basic Expo snack link. The text input is not taking the values I press on the keyboard. here is the expo link - https://snack.expo.dev/oD72PI5Xch. Can someone help me with what I am doing wrong?
Another issue I have noticed is that the keyboard doesn't show up if I press the back button and then again press the <Text> component from where I have called the onPress to call focus() on the TextInput. It will come up if I press the back button and then press the Text component only once. If I again close it using the back button, after that the keyboard stops coming up.
Below is the console log output based on the logging statements I have in the code snack (my actions are marked with >>>>>) -
1>>>>> App opens up
text input onfocus called
text input onblur called
keyboard did show
2>>>>> App stabilizes
3>>>>> I press the back button
keyboard did hide
4>>>>> I press the text component
calling focus
keyboard did show
5>>>>> I press the back button
keyboard did hide
6>>>>> I keep pressing the text component
calling focus
calling focus
calling focus
calling focus
calling focus
calling focus
I think the issue might be before the 2>>>>> part. The TextInput's onBlur is already called. That might be the reason why it is not taking keyboard inputs. Also, even after calling focus, the onFocus logging is absent, meaning that the text input never came into focus. What am I doing wrong? Thanks in advance :)
And if you solve this, please help me out with the issue of keyboard not appearing on pressing the Text component multiple times (6>>>>> part of the console output).
I don't clearly understand what are you trying to do by giving 0 height and width to TextInput, If you are trying to create an OTP input field you can simply use any third-party libraries like react-native-otp-input or try to use code from this existing snack
I'm currently building an order page that takes in only selected characters for my TextInput element.
My requirement is that when I focus on TextInput, the keyboard doesn't appear but I can still point the cursor around in the TextInput.
Tried using editable={false}, works for keyboard not appearing but disables cursor.
Is there a workaround to this where I can hide my keyboard but still use cursor?
What you are trying to do is not currently posisble in React Native, see this Github thread
I'm creating an app using react-native, the soft keyboard gets suppressed when there's a hardware keyboard connected. I need it to be shown.
I'm essentially asking the same question as here:Show soft keyboard even though a hardware keyboard is connected but specifically for react native.
You mean an external keyboard for your tablet?
You can try to set the keyboard type to 'null'.
You can also try to add the onPress="blur()" prop in your Input/TextInput