Dropdown column value becomes empty after pressing Tab (double closeEditor call reads a closed widget)
Author: hastalavista911Created Aug 6, 2026Updated Aug 6, 2026
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
Tabwhile a dropdown editor is open,keyDownControlsdoes not callcloseEditordirectly. Instead it callscurrent.edition[0].children[0].blur(). - That
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.- 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 cellRelated open issues (same symptom, no fix landed yet)
- #370 — "Dropdown Value Disappears After Tabbing Then Click"
- #1111 — "Open dropdown when down arrow is pressed and close when the tab key is pressed"
Workaround
Click another cell instead of pressing Tab after selecting a dropdown option.
Source: jspreadsheet/ce