-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
has: prSubject of a pull requestSubject of a pull request
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the issue
In https://reactnative.dev/docs/textinput, there's the showSoftInputOnFocus property that will prevent the soft keyboard from showing when the field is focused, but react-native-web does not support this yet.
Expected behavior
showSoftInputOnFocus property of <TextInput /> works correctly
Steps to reproduce
- Create a
TextInputwithshowSoftInputOnFocus=false - Open mobile browser, click on the TextInput
- We still see the keyboard open, the keyboard should not open
Test case
https://codesandbox.io/s/runtime-paper-lgmxb3
Additional comments
Since react-native-web does not support showSoftInputOnFocus yet, we need to make an update to support it
In https://github.com/Expensify/react-native-web -> packages/react-native-web/src/exports/TextInput/index.js
const {
+ showSoftInputOnFocus = true
} = props;
...
switch (keyboardType) {
case 'email-address':
type = 'email';
break;
case 'number-pad':
case 'numeric':
inputMode = 'numeric';
break;
case 'decimal-pad':
inputMode = 'decimal';
break;
case 'phone-pad':
type = 'tel';
break;
case 'search':
case 'web-search':
type = 'search';
break;
case 'url':
type = 'url';
break;
default:
type = 'text';
}
+ if (!showSoftInputOnFocus) {
+ inputMode = 'none';
+ }I can open a PR for this once this issue proposal is accepted.
Thanks!
cc @necolas
Metadata
Metadata
Assignees
Labels
has: prSubject of a pull requestSubject of a pull request