Package / version: jspreadsheet-ce 5.0.4 (latest on npm at time of writing)
Steps to reproduce
- Create a worksheet with a column of
type: 'dropdown' (see minimal reproduction below).
- Double-click the cell to open the dropdown editor.
- Pick an option (or leave the currently highlighted/default option as-is).
- Press Tab.
Minimal reproduction:
jspreadsheet(document.getElementById('spreadsheet'), {
worksheets: [{
data: [[1]],
columns: [
{ type: 'dropdown', title: 'Status', source: [
{ id: 1, name: 'Open' },
{ id: 2, name: 'Closed' }
] }
]
}]
});
Expected behavior
The selected value is committed to the cell, and focus moves to the next cell — standard Tab behavior.
Actual behavior
The cell value becomes empty.
Root cause (from reading the minified source, jspreadsheet.min.js)
- On
Tab while a dropdown editor is open, keyDownControls does not call closeEditor directly. Instead it calls current.edition[0].children[0].blur().
- That
blur() triggers the jSuites.dropdown widget's own close handling, which invokes the onclose callback registered in openEditor, roughly: onclose: function () { closeEditor.call(n, e, true); }.
closeEditor(e, true) (commit=true) for a dropdown column reads the value with r = e.children[0].dropdown.close(true); — calling .close(true) on the widget a second time, while it's already mid-close from the blur that triggered this whole chain.
- This second
.close(true) call reads from a widget instance whose internal state has already been torn down/reset by the first close, so it returns an empty value, which then gets written back to the cell.
Call chain summary:
blur()
-> jSuites.dropdown widget's own close handling
-> onclose callback -> closeEditor(e, true)
-> e.children[0].dropdown.close(true) // 2nd close call, widget already closing
-> returns empty value -> written to cell
Related open issues (same symptom, no fix landed yet)
Workaround
Click another cell instead of pressing Tab after selecting a dropdown option.
Package / version:
jspreadsheet-ce5.0.4 (latest on npm at time of writing)Steps to reproduce
type: 'dropdown'(see minimal reproduction below).Minimal reproduction:
Expected behavior
The selected value is committed to the cell, and focus moves to the next cell — standard Tab behavior.
Actual behavior
The cell value becomes empty.
Root cause (from reading the minified source,
jspreadsheet.min.js)Tabwhile a dropdown editor is open,keyDownControlsdoes not callcloseEditordirectly. Instead it callscurrent.edition[0].children[0].blur().blur()triggers thejSuites.dropdownwidget's own close handling, which invokes theonclosecallback registered inopenEditor, roughly:onclose: function () { closeEditor.call(n, e, true); }.closeEditor(e, true)(commit=true) for adropdowncolumn reads the value withr = e.children[0].dropdown.close(true);— calling.close(true)on the widget a second time, while it's already mid-close from the blur that triggered this whole chain..close(true)call reads from a widget instance whose internal state has already been torn down/reset by the first close, so it returns an empty value, which then gets written back to the cell.Call chain summary:
Related open issues (same symptom, no fix landed yet)
Workaround
Click another cell instead of pressing Tab after selecting a dropdown option.