-
Notifications
You must be signed in to change notification settings - Fork 129
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
Property to refresh/recalculate targetWidth #49
Comments
Your solution looks good enough to me, I don't think it justifies another property. If you have strong feelings about this and want to implement that feature I'd accept a PR. |
I didn't see this issue until after I had created such a property. I called the property width, and it simply forces a recalculate size after update if the width property changed. I will create a PR for it. |
You can now control the target size by changing the Thank you for your contribution! |
As described here: pablosichert/react-truncate#49
* Forced Truncate component to recalculate width As described here: pablosichert/react-truncate#49 * Refactored in order to minimize changes
In some cases it is necessary to re-render a truncate component although its existent props (children, ellipsis and lines) are not modified. For example, when size of a parent DOM-element (component) is changed without window resizing.
Now I use the following workaround to re-render the truncate component when necessary:
this.truncateRef.onResize();
But it would be useful to have special property which will trigger recalculation of
targetWidth
.The text was updated successfully, but these errors were encountered: