mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
fix(text): support start and end text alignment (#57201)
Summary: Closes https://github.com/react/react-native/issues/45255. Adds `textAlign: 'start' | 'end'` support for Text and TextInput across the JS types, Android, iOS, and Fabric text conversion paths. - Android legacy Text and TextInput now accept logical `start`/`end` alignment values. - Fabric preserves `start`/`end` as distinct `TextAlignment` values and resolves them against layout direction for iOS paragraph layout. - Existing `left`/`right` behavior is left unchanged to avoid changing current RTL semantics. This replaces https://github.com/react/react-native/issues/57007 because the original fork became locked and could not be updated after the upstream conflict. ## Changelog: [GENERAL] [ADDED] - Add support for `textAlign: 'start'` and `textAlign: 'end'`. Pull Request resolved: https://github.com/react/react-native/pull/57201 Test Plan: - `yarn build-types` - `yarn test-typescript` - `yarn flow-check` - `./node_modules/.bin/prettier --check packages/react-native/Libraries/Components/TextInput/TextInput.d.ts packages/react-native/Libraries/Components/TextInput/TextInput.flow.js packages/react-native/Libraries/StyleSheet/StyleSheetTypes.d.ts packages/react-native/Libraries/StyleSheet/StyleSheetTypes.js packages/react-native/types/__typetests__/index.tsx packages/react-native/ReactNativeApi.d.ts` - `./gradlew ktfmtCheck -Preact.internal.useHermesStable=true --no-daemon` - `./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest --tests com.facebook.react.views.textinput.ReactTextInputPropertyTest.testTextAlign --tests com.facebook.react.views.text.TextAttributePropsTest -Preact.internal.useHermesStable=true --no-daemon` - `./gradlew ':packages:react-native:ReactAndroid:buildCMakeDebug[arm64-v8a][hermestooling,jsi,etc]' -Preact.internal.useHermesStable=true --no-daemon` - `git diff --check` The Android unit test and CMake checks were run from an ASCII-only temporary worktree because Kotlin unit test compilation in my main checkout fails before running these tests when the workspace path contains non-ASCII characters. Reviewed By: christophpurrer Differential Revision: D108628602 Pulled By: javache fbshipit-source-id: 28111d0553451d7de0424a07e956f71bda8787ca
This commit is contained in:
1 parent
fd10410d51
commit
ca29d38537
27 files changed
+196
-27
No files matched your search
@@ -6517,10 +6517,12 @@ enum facebook::react::SubmitBehavior {
|
||||
|
||||
enum facebook::react::TextAlignment {
|
||||
Center,
|
||||
End,
|
||||
Justified,
|
||||
Left,
|
||||
Natural,
|
||||
Right,
|
||||
Start,
|
||||
}
|
||||
|
||||
enum facebook::react::TextAlignmentVertical {
|
||||
|
||||
@@ -6331,10 +6331,12 @@ enum facebook::react::SubmitBehavior {
|
||||
|
||||
enum facebook::react::TextAlignment {
|
||||
Center,
|
||||
End,
|
||||
Justified,
|
||||
Left,
|
||||
Natural,
|
||||
Right,
|
||||
Start,
|
||||
}
|
||||
|
||||
enum facebook::react::TextAlignmentVertical {
|
||||
|
||||
@@ -6508,10 +6508,12 @@ enum facebook::react::SubmitBehavior {
|
||||
|
||||
enum facebook::react::TextAlignment {
|
||||
Center,
|
||||
End,
|
||||
Justified,
|
||||
Left,
|
||||
Natural,
|
||||
Right,
|
||||
Start,
|
||||
}
|
||||
|
||||
enum facebook::react::TextAlignmentVertical {
|
||||
|
||||
@@ -8700,10 +8700,12 @@ enum facebook::react::SubmitBehavior {
|
||||
|
||||
enum facebook::react::TextAlignment {
|
||||
Center,
|
||||
End,
|
||||
Justified,
|
||||
Left,
|
||||
Natural,
|
||||
Right,
|
||||
Start,
|
||||
}
|
||||
|
||||
enum facebook::react::TextAlignmentVertical {
|
||||
|
||||
@@ -8542,10 +8542,12 @@ enum facebook::react::SubmitBehavior {
|
||||
|
||||
enum facebook::react::TextAlignment {
|
||||
Center,
|
||||
End,
|
||||
Justified,
|
||||
Left,
|
||||
Natural,
|
||||
Right,
|
||||
Start,
|
||||
}
|
||||
|
||||
enum facebook::react::TextAlignmentVertical {
|
||||
|
||||
@@ -8691,10 +8691,12 @@ enum facebook::react::SubmitBehavior {
|
||||
|
||||
enum facebook::react::TextAlignment {
|
||||
Center,
|
||||
End,
|
||||
Justified,
|
||||
Left,
|
||||
Natural,
|
||||
Right,
|
||||
Start,
|
||||
}
|
||||
|
||||
enum facebook::react::TextAlignmentVertical {
|
||||
|
||||
@@ -4855,10 +4855,12 @@ enum facebook::react::SubmitBehavior {
|
||||
|
||||
enum facebook::react::TextAlignment {
|
||||
Center,
|
||||
End,
|
||||
Justified,
|
||||
Left,
|
||||
Natural,
|
||||
Right,
|
||||
Start,
|
||||
}
|
||||
|
||||
enum facebook::react::TextAlignmentVertical {
|
||||
|
||||
@@ -4709,10 +4709,12 @@ enum facebook::react::SubmitBehavior {
|
||||
|
||||
enum facebook::react::TextAlignment {
|
||||
Center,
|
||||
End,
|
||||
Justified,
|
||||
Left,
|
||||
Natural,
|
||||
Right,
|
||||
Start,
|
||||
}
|
||||
|
||||
enum facebook::react::TextAlignmentVertical {
|
||||
|
||||
@@ -4846,10 +4846,12 @@ enum facebook::react::SubmitBehavior {
|
||||
|
||||
enum facebook::react::TextAlignment {
|
||||
Center,
|
||||
End,
|
||||
Justified,
|
||||
Left,
|
||||
Natural,
|
||||
Right,
|
||||
Start,
|
||||
}
|
||||
|
||||
enum facebook::react::TextAlignmentVertical {
|
||||
|
||||
Reference in new issue
Block a user