Steps to Reproduce
- Open a blank document in Keikai
- Right click on cell A1
- Select formatCell > Custom > "#,##0_);[Red](#,##0)"
- Click OK
- In cell A1, enter value 1.1, then press Enter
- In cell A1, enter value 1.2, then press Enter
Current Result
Cell is correctly formatted as "1" after first edit
Cell is incorrectly formatted as "1.2" after 2nd edit
Expected Result
Cell is formatted as "1" in both cases
Debug Information
zss.Cell.prototype.setText checks for cell this.text value and compare with new value before setting.
this.text is the same formatted text (1.1 formats to 1, 1.2 formats to 1), so setText returns without updating the cell, since the value of this.text is already "1", even though the actual cell text from getText() is 1.2
Workaround
<script><![CDATA[ zk.afterLoad("zss", function () { var _xCell = {}; zk.override(zss.Cell.prototype, _xCell, { setText: function (newText) { if (!newText) newText = ""; if (newText == this.text && newText == this.getText()) { // KEIKAI-168 return; } this._setText(newText); } }); }); ]]></script>
- relates to
-
KEIKAI-470 change a percentage cell value but the value in the formula bar doesn't change accordingly
- Closed