Repository navigation
fix: map text-align start/end to left/right - #471
Open
Abdalkaderdev wants to merge 1 commit into
Open
Abdalkaderdev wants to merge 1 commit into
Abdalkaderdev wants to merge 1 commit into
Conversation
parseTextAlign only allowed auto/left/right/center/justify, so the text-start and text-end utilities Tailwind v4 emits as text-align: start/end were dropped with a warning and no alignment was applied. React Native has no logical start/end for textAlign, but <Text> resolves left/right against the writing direction, so they are already the logical values and the mapping can be done at compile time with no runtime change. <TextInput> treats them as physical, which is a separate React Native issue (react/react-native#45255). Closes nativewind#454
Author
|
Credit where it's due: the root cause and the |
This branch has not been deployed
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.
Closes #454.
parseTextAlignonly allowedauto|left|right|center|justify, sotext-startandtext-end— which Tailwind v4 emits astext-align: start|end— were dropped with a warning and no alignment applied.React Native has no logical
start/endfortextAlign, but<Text>resolvesleft/rightagainst the writing direction (Expo localization guide), so they already behave as the logical values. That means the mapping can happen at compile time and needs no runtime change.Worth noting
<TextInput>treatsleft/rightas physical rather than logical — that is react/react-native#45255 and out of scope here.Added
text-startandtext-endcases to the existing Text Align block intypography.test.tsx. Both fail on main and pass with the change. The 4 failing tests insrc/__tests__/babelfail on a clean checkout of main too and are unrelated.