Skip to content

Commit b6869be

Browse files
gabrieldonadelfacebook-github-bot
authored andcommitted
feat: Update TextInput inputMode to map "none" to showSoftInputOnFocus (facebook#35228)
Summary: This PR updates `inputMode` prop from the `TextInput` component to map the `none` option to `showSoftInputOnFocus={false}` as suggested by necolas here -> facebook#34460 (comment). This change makes the inputMode API behaves a bit more similarly across platforms. Related to necolas/react-native-web#2421 ## Changelog [General] [Changed] - Update TextInput inputMode to map "none" to showSoftInputOnFocus ## Test Plan 1. Open the RNTester app and navigate to the TextInput page 2. Test the `TextInput` component through the `Input modes` section https://user-images.githubusercontent.com/11707729/200218435-6a33b319-e989-4086-aac3-506546982b38.mov Pull Request resolved: facebook#35228 Reviewed By: lunaleaps, necolas Differential Revision: D41081876 Pulled By: jacdebug fbshipit-source-id: cc634c3723647d8950bf2cfe67be70d0fbd488a6
1 parent 7a327d9 commit b6869be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Libraries/Components/TextInput/TextInput.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1602,6 +1602,7 @@ const ExportedForwardRef: React.AbstractComponent<
16021602
enterKeyHint,
16031603
returnKeyType,
16041604
inputMode,
1605+
showSoftInputOnFocus,
16051606
keyboardType,
16061607
...restProps
16071608
},
@@ -1628,6 +1629,9 @@ const ExportedForwardRef: React.AbstractComponent<
16281629
keyboardType={
16291630
inputMode ? inputModeToKeyboardTypeMap[inputMode] : keyboardType
16301631
}
1632+
showSoftInputOnFocus={
1633+
inputMode == null ? showSoftInputOnFocus : inputMode !== 'none'
1634+
}
16311635
autoComplete={
16321636
Platform.OS === 'android'
16331637
? // $FlowFixMe

0 commit comments

Comments
 (0)