frappe / datatable

The Missing Javascript Datatable for the Web
https://frappe.io/datatable
MIT License
1.02k stars 163 forks source link

Unexpected Newline Chars In Cell Content #105

Open stephancasas opened 4 years ago

stephancasas commented 4 years ago

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