Skip to content

clamping doesnt respect newlines  #36

Description

@doug31415

STR:

  • Add text with newlines, eg:
const text = '1\n 1\n  1\n  1\n  1\n  1\n  1\n  1\n  1\n  1\n  1\n  1\n  1\n  1\n  1\n  1\n '
<ClampLines
          className={this.state.cssClasses}
          text={this.text}
        />
  • Note that all the lines are collapsed into one line
  • Then add a CSS of white-space: pre-wrap
  • Note that newlines are preserved but no truncation occurs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions