Skip to content

fix(text): support start and end text alignment#57201

Open
SJvaca30 wants to merge 1 commit into
react:mainfrom
bbaebak:feat-textalign-start-end-rebased
Open

fix(text): support start and end text alignment#57201
SJvaca30 wants to merge 1 commit into
react:mainfrom
bbaebak:feat-textalign-start-end-rebased

Conversation

@SJvaca30

Copy link
Copy Markdown
Contributor

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'.

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.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 15, 2026
@github-actions

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jun 15, 2026
@meta-codesync

meta-codesync Bot commented Jun 15, 2026

Copy link
Copy Markdown

@javache has imported this pull request. If you are a Meta employee, you can view this in D108628602.

@SJvaca30 SJvaca30 force-pushed the feat-textalign-start-end-rebased branch from df93dcf to 2b7229b Compare June 23, 2026 05:53
@SJvaca30 SJvaca30 force-pushed the feat-textalign-start-end-rebased branch from 2b7229b to 277e0b8 Compare June 30, 2026 02:11
@SJvaca30

Copy link
Copy Markdown
Contributor Author

Thanks for importing this PR.

I cannot rerun the workflow from my fork because GitHub requires repository admin rights, so I looked through the failing public run.

The only public failure is Test All -> test_e2e_ios_rntester_retry_2 / report. In the retry_2 Debug job, Maestro exhausted retries on RNTester flows that look unrelated to this text-alignment change:

  • image-blur-prefetch
  • button

The log repeatedly shows simulator/permission connection failures, for example:

Unable to set permissions for app com.meta.RNTester.localDevelopment: Failed to connect to /127.0.0.1:...
Error: spawnSync /bin/sh ETIMEDOUT

The PR changes are limited to text alignment support/API snapshots, and the non-e2e checks are passing. Could someone with permission rerun Test All or the iOS RNTester e2e group? I can investigate further if there is a signal that this is related to the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for textAlign:start/end

1 participant