table icon indicating copy to clipboard operation
table copied to clipboard

Add option to disable wrapping text

Open IanEdington opened this issue 5 years ago • 5 comments
trafficstars

When width is set, cell text is always wrapped. In some cases this is undesirable. For example adding formatting that will shrink the effective size of the cell. see gajus/table#117

This is a quick and dirty PR to get started on this feature. Obviously tests and docs are needed, just wanted to get feedback before going further.

disableWrap is a boolean option on columns that allows bypassing the text wrap functions altogether.

IanEdington avatar Aug 12 '20 18:08 IanEdington

Pull Request Test Coverage Report for Build 232

  • 7 of 10 (70.0%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.007%) to 72.941%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/alignTableData.js 0 1 0.0%
src/calculateRowHeightIndex.js 2 3 66.67%
src/wrapCell.js 1 2 50.0%
<!-- Total: 7 10
Totals Coverage Status
Change from base Build 230: -0.007%
Covered Lines: 174
Relevant Lines: 240

💛 - Coveralls

coveralls avatar Aug 12 '20 18:08 coveralls

I can see the use case for this.

gajus avatar Aug 12 '20 23:08 gajus

Cool! I'm happy to flesh out this PR if it's likely to get merged

also running into an issue with eslint-config-canonical version miss match with eslint? (see travis) It looks like it's failing on master

IanEdington avatar Aug 13 '20 00:08 IanEdington

The build is now working.

gajus avatar Aug 30 '20 17:08 gajus

@IanEdington If you rebase, the CI/CD is now working as expected.

gajus avatar Jan 02 '21 02:01 gajus