let isTabPressed = false;
document.addEventListener('keydown', function (e) {
if (e.key === 'Tab') {
isTabPressed = true;
}
});
document.addEventListener('keyup', function (e) {
if (e.key === 'Tab') {
isTabPressed = false;
// Collapse all expanded ComboBoxes
Ext.ComponentQuery.query('combobox').forEach(combo => {
if (combo.isExpanded && combo.isExpanded()) {
combo.collapse();
// Also blur the combobox to release focus
if (combo.getFocusEl) {
combo.getFocusEl().blur();
}
}
});
}
});