fix(ios): align text to the right by default in RTL#57634
Open
zoontek wants to merge 1 commit into
Open
Conversation
|
@Abbondanzo has imported this pull request. If you are a Meta employee, you can view this in D113244783. |
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:
On the new architecture,
<Text>without an explicittextAlignbehaves differently across platforms when the layout direction is RTL:This is a regression from the old architecture, where both platforms left text alone when
textAlignwas unset. The new arch changed Android's default, and the two platforms are now inconsistent.This PR makes iOS match the current Android (new arch) behavior: without an explicit
textAlign, text follows the layout direction and aligns to the right in RTL. On iOS,Naturalalignment now resolves toRightunder RTL.Open question
I aligned iOS to Android's new default, but I'm not sure it's the right call (my guts feeling think that is the right thing to do, tho). The old-arch behavior (do nothing when
textAlignis unset) may be what's actually expected, in which case the fix should go the other way: revert Android to leave text untouched and keep iOS as-is. Happy to flip the direction if reviewers prefer that.Changelog:
[IOS] [FIXED] - Align text to the right by default in RTL when
textAlignis not set, matching AndroidTest Plan:
Edit
RNTesterAppShared.js, press the button, reload the app - comment / uncommentTexttextAlignstyle:Old architecture (baseline):
New architecture (before this PR, iOS diverges):
New architecture (after this PR, iOS fixed):