facebook / facebook/litho

alignItems & baseline is not working properly with Text alignment

Open
#789 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
7.8k
Forks
768
PR merge metrics
No merged PRs in 30d

Description

- [x] I have searched [existing issues](https://github.com/facebook/litho/issues) and this is not a duplicate

## Version
The latest code on master branch.

## Issues and Steps to Reproduce
Paste the code below to `PlaygroundComponentSpec` and run Litho **sample** project, click on Playground button and you will see this:
![2](https://user-images.githubusercontent.com/1622320/116778330-d1222880-aaa3-11eb-8496-7d5009fdaa97.jpg)

## Expected Behavior
![1](https://user-images.githubusercontent.com/1622320/116778319-c36ca300-aaa3-11eb-8cd3-fd1900a614c2.jpg)

## Link to Code

```java
@LayoutSpec
public class PlaygroundComponentSpec {

@OnCreateLayout
static Component onCreateLayout(ComponentContext c) {
return Row.create(c)
.paddingDip(YogaEdge.ALL, 24f)
.alignItems(YogaAlign.BASELINE)
.child(Text.create(c).text("$").textSizeDip(13f).backgroundColor(0x10000000))
.child(Text.create(c).text("16").textSizeDip(33f).lineHeightDip(33f).backgroundColor(0x20000000))
.child(Text.create(c).text(".87").textSizeDip(13f).backgroundColor(0x10000000))
.build();
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.