Posted 14 September 2017, 11:21 am EST
This one is difficult to reproduce but it affects our app to the extent that we would need to drop wijmo if unresolved.
The editor drops characters when initiating an edit using the keyboard making multiple keystrokes in quick succession.
Here’s the scenario:
- A cell has a value such as “TEST”
- We select the cell (without activating the editor) then initiate an edit by typing “123” in quick succession using the number pad.
- The editor is rendered and contains just the characters “13” or “1” however “12” or “123” flash for a fraction of a second before being replaced with “13” or “1”
I have narrowed the bug down to two lines line in wijmo.grid.ts 5.20151.51
Line 6164 & 6165:
[js]
edt.value = String.fromCharCode(e.charCode);
edt.setSelectionRange(1, 1);
[/js]
This is embedded in a timeout and when line 6164 executes, edt.value == either “12” or “123” and String.fromCharCode(e.charCode) == “1”
So “12” or “123” are replaced in the editor with “1” and the caret is moved to 1 resulting in either “13” if the third keystroke is inserted after line 6165 executes or “1” if had already been inserted.
Commenting out lines 6164 & 6165 seems to fix the issue for us but we’re keen for an official fix.
Additionally there is another bug which is a little easier to reproduce.
The value inside the editor is overwritten with the original value from the cell if a refresh occurs while editing a cell even if the refresh is supposed to be specific to a single row which isn’t currently being edited.
In our case, each time a cell edit is complete we send the entire row to a server API for cross reference validation. Once the server responds with the result then we need to do a refresh of that row so that it can be decorated with the appropriate css styles to display validation markers and highlighting etc.
[js]
self._grid.refreshCells(true, false, new wijmo.grid.CellRange(row));
[/js]
If another cell is being edited when the response is received and subsequent refreshCells call made, the value in the editor is replaced with the original value from the cell.
When we make a refreshCells call for a single row, why can’t just that row be refreshed instead of the entire grid?


