You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I put a Truncate component in a div with padding, the generated elements are too long. Once I removed the padding, the generated elements fit to the appropriate number of lines.
It seems that you are calculating the appropriate width based on the width of the window and not the width of the Truncate component's parent. Consequently, if you calculate the width of the parent div instead of the window, you can rely on normal text wrapping instead of the current span + br pattern.
Example: go to your demo page, inside ReadMore.js, add this to div surrounding the Truncate component: style={{padding: 15}}
The text was updated successfully, but these errors were encountered:
If I put a Truncate component in a div with padding, the generated elements are too long. Once I removed the padding, the generated elements fit to the appropriate number of lines.
It seems that you are calculating the appropriate width based on the width of the window and not the width of the Truncate component's parent. Consequently, if you calculate the width of the parent div instead of the window, you can rely on normal text wrapping instead of the current span + br pattern.
Example: go to your demo page, inside ReadMore.js, add this to div surrounding the Truncate component:
style={{padding: 15}}
The text was updated successfully, but these errors were encountered: