Fix tab focus issue when closing query tool using keyboard shortcut. #6572

pull/7687/head
Aditya Toshniwal 2024-07-23 17:02:39 +05:30
parent 18d507780d
commit 026292f07b
1 changed files with 11 additions and 11 deletions

View File

@ -188,17 +188,17 @@ _.extend(pgBrowser.keyboardNavigation, {
}
},
_focusTab: function(dockLayoutTabs, activeTabIdx, shortcut_obj, combo){
if (combo.key === shortcut_obj.tabbed_panel_backward) activeTabIdx = (activeTabIdx + dockLayoutTabs.length - 1) % dockLayoutTabs.length;
else if (combo.key === shortcut_obj.tabbed_panel_forward) activeTabIdx = (activeTabIdx + 1) % dockLayoutTabs.length;
else if (combo.key === shortcut_obj.close_tab_panel) {
if(combo.key === shortcut_obj.close_tab_panel) {
const panelId = dockLayoutTabs[activeTabIdx].id?.slice(14);
if (panelId) {
pgAdmin.Browser.docker.close(panelId);
activeTabIdx = activeTabIdx === dockLayoutTabs.length - 1 || activeTabIdx === 0 ? 1 : activeTabIdx + 1;
}
}
} else {
if (combo.key === shortcut_obj.tabbed_panel_backward) activeTabIdx = (activeTabIdx + dockLayoutTabs.length - 1) % dockLayoutTabs.length;
else if (combo.key === shortcut_obj.tabbed_panel_forward) activeTabIdx = (activeTabIdx + 1) % dockLayoutTabs.length;
dockLayoutTabs[activeTabIdx]?.click();
dockLayoutTabs[activeTabIdx]?.focus();
}
},
bindLeftTree: function() {
const tree = this.getTreeDetails();