mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix(plugin-tools-panel): CB-2286 fix default selected tab
This commit is contained in:
@@ -53,7 +53,7 @@ export const TabsState = observer(function TabsState<T = Record<string, any>>({
|
||||
const props = rest as any as T;
|
||||
if (
|
||||
!selectedId
|
||||
&& !currentTabId
|
||||
&& currentTabId === undefined
|
||||
&& container
|
||||
) {
|
||||
const displayed = container.getIdList(props);
|
||||
@@ -88,7 +88,7 @@ export const TabsState = observer(function TabsState<T = Record<string, any>>({
|
||||
tabList,
|
||||
});
|
||||
|
||||
if (currentTabId) {
|
||||
if (currentTabId !== undefined) {
|
||||
state.selectedId = currentTabId;
|
||||
dynamic.selectedId = currentTabId;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,12 @@ export const ToolsPanel = observer<Props>(function ToolsPanel({ container }) {
|
||||
}
|
||||
|
||||
return styled(useStyles(tabStyle, formStyles))(
|
||||
<TabsState currentTabId={state.selectedTabId} container={container} lazy onChange={handleTabChange}>
|
||||
<TabsState
|
||||
currentTabId={state.selectedTabId ?? undefined}
|
||||
container={container}
|
||||
lazy
|
||||
onChange={handleTabChange}
|
||||
>
|
||||
<box>
|
||||
<TabList style={tabStyle} />
|
||||
<content-box>
|
||||
|
||||
Reference in New Issue
Block a user