-
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
[Layout] CSS min-height/max-height #1284
Comments
The React docs say they aren't supported but css-layout says they are: https://github.com/facebook/css-layout#supported-attributes. So I believe React's copy of css-layout needs to be updated and the new properties exposed to Views. |
@vjeux can we get periodic updates of css-layout to keep it up-to-date ex: maybe the on-call does a weekly sync? We also wouldn't want css-layout to get too far ahead of React and accumulate features that need be reverted because they break apps in ways that are hard to fix. |
Yes, we have fallen behind. Unfortunately, bringing up the latest version breaks some of our products internally so I have to update them as well. As for min/max height, unfortunately the current implementation in css-layout is NOT complete enough that it should be added to react native. There are many cases that it doesn't support correctly. |
OK, thanks for the update. |
Thanks for the prompt update. Not sure if it could simplify, but I guess that having min/max height only for Text could already be a big step forward. Also, having just one of two, as most of the time you can work on a dual problem. My use case, for instance, is a view with an image and a text hidden behind. On click, I want to bring the text in front and the image behind. Edit: reworded the use case/problem to make it more clear (see later comments) |
Can't you use numberOfLines attribute of the Text for this? |
Sorry, I explained in a confusing way. |
You might be able to use onLayout as a workaround - based on the height of the rendered text you could add some margin as necessary. |
How should min/max height work on images? |
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed. |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out it's new home: https://productpains.com/post/react-native/layout-css-min-heightmax-height |
I don't think this feature should use product pains to determine whether or not implement. |
minHeight , maxHeight properties works in iOS but not in android. is there any workaround for this? |
+1 |
I've tried minHeight on Android using React Native v0.39.2, and it seems to be working fine |
Are these available, at least for Text?
Any trick to achieve that anyway?
The text was updated successfully, but these errors were encountered: