Allow vertical overflow for Text with numberOfLines={1}#2836
Open
mozzius wants to merge 4 commits intonecolas:masterfrom
Open
Allow vertical overflow for Text with numberOfLines={1}#2836mozzius wants to merge 4 commits intonecolas:masterfrom
numberOfLines={1}#2836mozzius wants to merge 4 commits intonecolas:masterfrom
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit e3e5f28:
|
Contributor
Author
|
Dammit I did not mean to link these PRs together |
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.
Setting
numberOfLineson Text causes the text to get clipped in both axis, which means if you have a smaller line height it might clip ascenders/descenders. Exaggerated example:The fix is to use
overflow-inline: clipinstead ofoverflow: hidden, so that it just clips it in the horizontal axis. This matches React Native's behaviour on iOS/Android. Unfortunately this only works for single-line clamps - to my knowledge it's unfixable for multi-line clamps.overflow-inlineis baseline newly available, if that's a problem we could useoverflow-x: clipinstead. However, that wouldn't support vertical writing modes :/. If that's an unreasonable compromise, feel free to put this PR on ice for however many years it takes to become widely available :)