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

Determine how many lines are generated through a component

Open nmagathan opened this issue 6 years ago • 2 comments

I am importing this into a component, but I want to determine how many lines were generated to do some functionality on. Is there a way to get this within my component?

nmagathan avatar May 30 '18 19:05 nmagathan

@nmagathan if you pass line prop to Truncate with a value >= 1, then this should result in the number of lines before truncation. If no value is passed, then you should get one line.

I am not sure if this answers your question.

moubi avatar Aug 10 '18 12:08 moubi

@moubi , I think @nmagathan wants to get the number of lines that were generated for the input text. If I set lines to 2 but the input length fits within the width of the container in less than 2 lines, it wouldn't be truncated.

redthree avatar Jan 24 '19 12:01 redthree