frappe / frappe/datatable

Unexpected Newline Chars In Cell Content

Open
#105 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
1.3k
Forks
216
PR merge metrics
No merged PRs in 30d

Description

If cell data contains a trailing whitespace character, four (4) additional newline chars will be appended to the text node inside of the `dt-cell__content` div. This can cause the `text-overflow: ellipsis;` CSS rule to engage prematurely, and will unnecessarily truncate the content of the cell.

It would seem that this is a result of using a template string to format the cell HTML. I've referenced line 864 of cellmanager.js where this is declared. Collapsing the template string to a single line should fix this issue. If this exceeds max line length, concatenating the variables prior to integrating into the template string may be another option.

https://github.com/frappe/datatable/blob/a0901768d7863bce407e37710b916f1c4c4cea9a/src/cellmanager.js#L864-L872

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.