docs: note that TextInput textAlign does not flip in RTL unlike Text#5175
Open
Noitidart wants to merge 1 commit into
Open
docs: note that TextInput textAlign does not flip in RTL unlike Text#5175Noitidart wants to merge 1 commit into
Noitidart wants to merge 1 commit into
Conversation
The shared textAlign docs (text-style-props.md) did not mention that its behavior diverges between <Text> and <TextInput> in RTL mode. On <Text>, textAlign: 'left' behaves as logical start (aligns right in RTL), but on <TextInput> it is physical and stays left on both iOS and Android. This adds a note documenting the divergence and the direction-aware workaround, linking to react/react-native#45255. PRs #57007 and #57201 attempted to add start/end support but were closed without merge, so documenting the existing behavior is the pragmatic outcome.
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
The shared
textAligndocs intext-style-props.md(used by both<Text>and<TextInput>) did not mention that its behavior diverges between the two components in RTL mode.<Text>:textAlign: 'left'behaves as logicalstart(aligns right in RTL)<TextInput>:textAlign: 'left'is physical (stays left in RTL) — on both iOS and AndroidThis PR adds a note to the
textAlignsection documenting the difference, showing the direction-aware workaround (I18nManager.isRTL ? 'right' : 'left'), and linking to #45255.Why docs-only?
PRs #57007 and #57201 attempted to add
textAlign: 'start'/'end'support — both were closed without merge. Documenting the existing behavior is the pragmatic outcome.Note on placement
textAlignis not documented directly intextinput.md(that page only has astylesection linking out to the shared text style props), so the canonicaltextAlignsection intext-style-props.mdis where this note belongs.