mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(core-ui): CB-1826 default tab selection
This commit is contained in:
@@ -98,7 +98,11 @@ export const TabsState = observer(function TabsState<T = Record<string, any>>({
|
||||
const tabExists = displayed.some(tabInfo => tabInfo.key === dynamic.selectedId);
|
||||
|
||||
if (displayed.length && !tabExists) {
|
||||
state.selectedId = selectedId;
|
||||
if (displayed.some(tabInfo => tabInfo.key === selectedId)) {
|
||||
state.selectedId = selectedId;
|
||||
} else {
|
||||
state.selectedId = displayed[0].key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user