-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flex alignItems "baseline" not aligning consistently like on web #20666
Comments
Can you reproduce the issue on the latest release, v0.56? |
yes. |
+1 @osdiab: How is your component structured? I believe baseline alignment has only worked with siblings, and does not interact with line-height in the same way as the CSS spec specifies. |
You can see in the code samples I posted above for details on the structure; it's not a complex layout, but I'll think more about how can possibly make this even simpler (kinda hard to imagine though) |
Anybody have a chance to look at this? |
@react-native-bot I meet the same problem:
Environment:React Native Environment Info: |
If you wrap the
workaround found here: #15858 (comment) |
@elucaswork Do you know if there's a way to use the functionality of I currently have the following use case where one text node is aligned on the left side of the screen, while the other is on the right. But without wrapping the nodes in
However, due to the properties of nested |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Summary: This fixes #20666 and #21918. This is pretty much the same as 51b3529 but implemented for Android. Now <Text> exposes the actual base-line offset value that allows Yoga to position it properly when `alignItems: baseline` is requested. ## Changelog [Android][Fixed] - Fixed `alignItems: baseline` for <Text> elements on Android Pull Request resolved: #31575 Test Plan: The same test case that we have for iOS. Before: <img width="487" alt="Screen Shot 2021-05-22 at 7 03 18 PM" src="https://user-images.githubusercontent.com/22032/119277516-d62b5100-bbe5-11eb-9141-3abe56e1a476.png"> After: <img width="487" alt="Screen Shot 2021-05-22 at 7 01 51 PM" src="https://user-images.githubusercontent.com/22032/119277518-d75c7e00-bbe5-11eb-9139-4c6b5fcd9157.png"> Reviewed By: JoshuaGross Differential Revision: D28631468 Pulled By: yungsters fbshipit-source-id: 7c259e469d19d8344298319f066b8437dfdedad0
Environment
Description
On the web,
align-items: baseline
is relative to first line: https://codepen.io/osdiab/pen/KBYyzzOn
react-native
, it seems to be happening relative to the last line, apparently, which is not very useful to me. See the demo.Reproducible Demo
https://snack.expo.io/By8Qr7xIX
Screenshots
react-native
web
The text was updated successfully, but these errors were encountered: