fix(text): support start and end text alignment#57007
Closed
SJvaca30 wants to merge 1 commit into
Closed
Conversation
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
4cf06e3 to
e431f6f
Compare
e431f6f to
d5a84b5
Compare
Contributor
Author
|
Replaced by #57201. The original fork is locked, so I can no longer update this branch. |
meta-codesync Bot
pushed a commit
that referenced
this pull request
Jul 1, 2026
Summary: Closes #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 #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: #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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Closes #45255.
Adds
textAlign: 'start' | 'end'support for Text and TextInput across the JS types, Android, iOS, and Fabric text conversion paths.start/endalignment values.start/endas distinctTextAlignmentvalues and resolves them against layout direction for iOS paragraph layout.left/rightbehavior is left unchanged to avoid changing current RTL semantics.Changelog:
[GENERAL] [ADDED] - Add support for
textAlign: 'start'andtextAlign: 'end'.Test Plan:
yarn build-typesyarn test-typescriptyarn 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 --rerun-tasks --no-daemon./gradlew ':packages:react-native:ReactAndroid:buildCMakeDebug[arm64-v8a][hermestooling,jsi,etc]' -Preact.internal.useHermesStable=true --no-daemongit diff --checkI also attempted to run iOS RNTester unit tests locally, but CocoaPods setup fails before tests start in this checkout because the workspace path contains non-ASCII characters (
incompatible character encodings: UTF-8 and BINARY (ASCII-8BIT)) and the workspace has no generated Pods checked in.