-
Bug
-
Resolution: Fixed
-
Normal
-
5.12.0
-
None
-
Security Level: Jimmy
-
None
Steps to Reproduce
run attached xlsx
Current Result
Rows that contains a cell with wrapped text, and have auto-height are shrunk
Expected Result
Rows should have at least their natural height (same as Excel)
Debug Information
Workaround
<script><![CDATA[ zk.afterLoad("zssex", function () { var _xRow = {}; zk.override(zss.Row.prototype, _xRow, { updateRowAutoHeight: function () { var naturalHeight = this.getHeight(); if (this.sheet.custRowHeight.isCustomSize(this.r)) { return; } var autoHeight = -1, autoHeightCells = this.autoHeightCells; if (autoHeightCells.length > 0) { var largestAutoHeight = this._largestAutoHeight || -1; if(largestAutoHeight == -1) { //enlarge height upon largest text height among wrapped cells var i = autoHeightCells.length; while (i--) { if (autoHeightCells[i]) { autoHeight = Math.max(autoHeight, autoHeightCells[i].getTextHeight()); } } this._largestAutoHeight = autoHeight; } else { // use cache autoHeight = Math.max(autoHeight, largestAutoHeight); } } if (autoHeight == -1) //use default autoHeight = this.sheet.custRowHeight.getDefaultSize(); const custRowHeight = this.sheet.custRowHeight; const meta = custRowHeight.getMeta(this.r); const rowHeight = meta ? meta[1] : custRowHeight.size; autoHeight = Math.max(naturalHeight, naturalHeight); if (rowHeight == autoHeight) return;//equals to current row height, no need to change var CUSTOM = false; this.sheet._setRowHeight(this.r, autoHeight, true, false, false, this.zsh, CUSTOM); } }); }); ]]></script>
- relates to
-
KEIKAI-657 provide a min-height property for rows with auto height calculation
- Closed