react-truncate icon indicating copy to clipboard operation
react-truncate copied to clipboard

Wrong width calculation when using text-transform

Open lilles88 opened this issue 8 years ago • 0 comments

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.

lilles88 avatar Nov 06 '17 12:11 lilles88