Skip to content
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

Handle case element height equal zero #283

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

nkdengineer
Copy link
Contributor

@nkdengineer nkdengineer commented Apr 11, 2024

Details

Currently, we didn't check if the height is positive before returning the value. The height could be 0 if the parent element was not fully rendered in the DOM yet.

So on layout change, when we use the method to get the element height here to use as maxHeight, we're getting 0 as the height

To fix this: if the height is 0, we should return auto as the height

This is similar to the logic when numberOfLines is not defined here . There's a bug there also, the condition after || will never be triggered, it should be styles.height ? '${styles.height}px' : 'auto'.

Related Issues

Expensify/App#39303

Manual Tests

Linked PRs

Copy link

github-actions bot commented Apr 11, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@nkdengineer nkdengineer changed the title fix: case element height equal 0 Handle case element height equal zero Apr 11, 2024
@nkdengineer nkdengineer marked this pull request as ready for review April 11, 2024 08:52
@tomekzaw
Copy link
Collaborator

@nkdengineer Thanks for the PR! We'll review it shortly

@nkdengineer
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@BartoszGrajdek
Copy link
Collaborator

Reviewing! 👀

Copy link
Collaborator

@BartoszGrajdek BartoszGrajdek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

cc @tomekzaw please merge this once you think we can safely upgrade the version of react-native-live-markdown in Expensify 🙏🏻

@tomekzaw tomekzaw merged commit 3ee55eb into Expensify:main Apr 11, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants