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

Reset noclamp state to false when props text changes #58

Open
JakeBaumbaugh opened this issue Oct 26, 2022 · 0 comments
Open

Reset noclamp state to false when props text changes #58

JakeBaumbaugh opened this issue Oct 26, 2022 · 0 comments

Comments

@JakeBaumbaugh
Copy link

When changing the inner text, the noclamp state is not reset to false. This becomes an issue when going from short text (which does not get clamped, i.e. noclamp set to false) to long text (needs clamped). The text is still cut off at the line count, but the ellipses and "Read More" button do not appear.

I believe setting noclamp to false when detecting the text change in componentDidUpdate should do the trick. Alternatively, calling this.action instead of this.clampLines in componentDidUpdate may be preferred.

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

No branches or pull requests

1 participant