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

<br> tags being added to truncated lines

Open macsplan opened this issue 6 years ago • 8 comments

Hi, any way of turning off the generation of
tags inside the truncated text?

Checked the docs but doesn't seem clear.

macsplan avatar Nov 04 '19 03:11 macsplan

Yes, I have such issue too. And it break all view. I resolve it by br: display none, but it isn’t good. Need add space for after span - bad hack

Lemaro86 avatar Dec 10 '19 16:12 Lemaro86

+1 Same issue ...

Jaikant avatar Mar 02 '20 08:03 Jaikant

+1 Any update on this one yet?

educepter avatar Mar 29 '20 19:03 educepter

  • 1 same issue.

stofancy avatar Jul 12 '20 11:07 stofancy

+1 here I guess the problem is here:

renderLine(line, i, arr) {
        if (i === arr.length - 1) {
            return <span key={i}>{line}</span>;
        } else {
            const br = <br key={i + 'br'} />;

            if (line) {
                return [
                    <span key={i}>{line}</span>,
                    br
                ];
            } else {
                return br;
            }
        }
    }

rodrigoBerlochi avatar Aug 14 '20 15:08 rodrigoBerlochi

@pablosichert Same issue. Any updates on this?

sharanya5 avatar Sep 30 '20 07:09 sharanya5

Still the case, would love an update

UndeadBaneGitHub avatar Jan 02 '22 00:01 UndeadBaneGitHub

+1 same issue. br tag is injected at random places and using display: none with margin to the span messes up the text

NwosaEmeka avatar Apr 02 '23 18:04 NwosaEmeka