mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Add missing textAlignVertical on TextInputAndroidProps (Flow) (#57427)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/57427 **Motivation** [`textAlignVertical`](https://reactnative.dev/docs/text-style-props#textalignvertical-android) is a real, documented prop which exists on the manual TS types but was not defined in Flow. The prop reaches `<AndroidTextInput>` at runtime via a spread operation: https://www.internalfb.com/code/fbsource/[35bb10d088a0]/xplat/js/react-native-github/packages/react-native/Libraries/Components/TextInput/TextInput.js?lines=653-656 **This change** Type missing prop, exposing this API to Flow and the generated Strict API types — annotated with `platform android`. **Sidenote: Should this prop exist?** `<TextInput>` also respects `style: {verticalAlign: 'auto' | 'bottom' | 'middle' | 'top'}`, mapping this to `textAlignVertical` on Android — **they are equivalent**. Therefore, it's tempting to drop `textAlignVertical` entirely, however neither it nor `style.verticalAlign` are implemented on iOS — therefore the explicit prop with `platform android` edges out. This diff upholds the current state of the world. Changelog: [General][Fixed] - **Strict TypeScript API**: Add missing `textAlignVertical` prop on `<TextInput>` Reviewed By: cortinico Differential Revision: D106183984 fbshipit-source-id: 597f8815e41dc959aa44f6fbb4fa8b6a588c2e8b
This commit is contained in:
1 parent
23608d6802
commit
e04ff69ab3
2 files changed
+12
-4
No files matched your search
@@ -506,6 +506,13 @@ export type TextInputAndroidProps = Readonly<{
|
||||
*/
|
||||
textBreakStrategy?: ?('simple' | 'highQuality' | 'balanced'),
|
||||
|
||||
/**
|
||||
* Align the input text to the top, center, or bottom of the field.
|
||||
* Defaults to `'auto'`.
|
||||
* @platform android
|
||||
*/
|
||||
textAlignVertical?: ?('auto' | 'top' | 'bottom' | 'center'),
|
||||
|
||||
/**
|
||||
* The color of the `TextInput` underline.
|
||||
* @platform android
|
||||
|
||||
+5
-4
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<67eb674c33870c82986054f0cee48385>>
|
||||
* @generated SignedSource<<82e308c1a4f2f713285c7586ff3eb618>>
|
||||
*
|
||||
* This file was generated by scripts/js-api/build-types/index.js.
|
||||
*/
|
||||
@@ -5051,6 +5051,7 @@ declare type TextInputAndroidProps = {
|
||||
readonly rows?: number
|
||||
readonly selectionHandleColor?: ColorValue
|
||||
readonly showSoftInputOnFocus?: boolean
|
||||
readonly textAlignVertical?: "auto" | "bottom" | "center" | "top"
|
||||
readonly textBreakStrategy?: "balanced" | "highQuality" | "simple"
|
||||
readonly underlineColorAndroid?: ColorValue
|
||||
}
|
||||
@@ -6135,8 +6136,8 @@ export {
|
||||
TaskProvider, // 266dedf2
|
||||
Text, // f792e51d
|
||||
TextContentType, // 239b3ecc
|
||||
TextInput, // 1c32d882
|
||||
TextInputAndroidProps, // 3f09ce49
|
||||
TextInput, // 4d0a088b
|
||||
TextInputAndroidProps, // 7109938a
|
||||
TextInputBlurEvent, // b77af40e
|
||||
TextInputChangeEvent, // f55eef98
|
||||
TextInputContentSizeChangeEvent, // a27cd32a
|
||||
@@ -6145,7 +6146,7 @@ export {
|
||||
TextInputIOSProps, // 0d05a855
|
||||
TextInputInstance, // 5a0c0e0d
|
||||
TextInputKeyPressEvent, // 546c5d07
|
||||
TextInputProps, // 08c36ff7
|
||||
TextInputProps, // a56c62a0
|
||||
TextInputSelectionChangeEvent, // e58f2abc
|
||||
TextInputSubmitEditingEvent, // 6bcb2aa5
|
||||
TextInstance, // 05463a96
|
||||
|
||||
Reference in new issue
Block a user