react-truncate
react-truncate copied to clipboard
Wrong width calculation when using text-transform
There is a bug in the width calculation logic that does not take text-transform CSS property into account. I have transformed my text to uppercase using this property, and the results are not what I expected, clearly because capital letters take up more space than normal ones.
As I observed the source code a bit, I think you should amend the styling query at L148 to also add the text-transform property.
The current workaround is to call .toUpperCase() on the input string, but it would be nice if this could be done through CSS.