fix(text): support start and end text alignment#57201
Conversation
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
|
@javache has imported this pull request. If you are a Meta employee, you can view this in D108628602. |
df93dcf to
2b7229b
Compare
2b7229b to
277e0b8
Compare
|
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
The log repeatedly shows simulator/permission connection failures, for example: The PR changes are limited to text alignment support/API snapshots, and the non-e2e checks are passing. Could someone with permission rerun |
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.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'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 --no-daemon./gradlew ':packages:react-native:ReactAndroid:buildCMakeDebug[arm64-v8a][hermestooling,jsi,etc]' -Preact.internal.useHermesStable=true --no-daemongit diff --checkThe 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.