diff --git a/src/lib/viewers/text/BoxCSV.js b/src/lib/viewers/text/BoxCSV.js index dd82f7c1b..010935d67 100644 --- a/src/lib/viewers/text/BoxCSV.js +++ b/src/lib/viewers/text/BoxCSV.js @@ -72,8 +72,9 @@ class BoxCSV { * @private */ renderCSV() { - const rowCount = this.data.length; - const rowSample = this.data.sort((a, b) => b.length - a.length)[0]; // Find the row with the most columns + const rowData = [...this.data]; + const rowCount = rowData.length; + const rowSample = rowData.sort((a, b) => b.length - a.length)[0]; // Find the row with the most columns const columnCount = rowSample.length; const maxWidth = this.csvEl.clientWidth;