diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx
index a1d19e257..e56341d80 100644
--- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx
+++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx
@@ -307,18 +307,11 @@ function createOpenSynapseLinkDialogButton(container: Explorer): CommandButtonCo
function createNewDatabase(container: Explorer): CommandButtonComponentProps {
const label = "New " + getDatabaseName();
- const newDatabaseButton = document.activeElement as HTMLElement;
-
return {
iconSrc: AddDatabaseIcon,
iconAlt: label,
onCommandClick: () =>
- useSidePanel
- .getState()
- .openSidePanel(
- "New " + getDatabaseName(),
-
- ),
+ useSidePanel.getState().openSidePanel("New " + getDatabaseName(), ),
commandButtonLabel: label,
ariaLabel: label,
hasPopup: true,
diff --git a/src/Explorer/Panes/AddDatabasePanel/AddDatabasePanel.tsx b/src/Explorer/Panes/AddDatabasePanel/AddDatabasePanel.tsx
index 2c5009282..3ee59bd30 100644
--- a/src/Explorer/Panes/AddDatabasePanel/AddDatabasePanel.tsx
+++ b/src/Explorer/Panes/AddDatabasePanel/AddDatabasePanel.tsx
@@ -23,12 +23,10 @@ import { RightPaneForm, RightPaneFormProps } from "../RightPaneForm/RightPaneFor
export interface AddDatabasePaneProps {
explorer: Explorer;
- buttonElement?: HTMLElement;
}
export const AddDatabasePanel: FunctionComponent = ({
explorer: container,
- buttonElement,
}: AddDatabasePaneProps) => {
const closeSidePanel = useSidePanel((state) => state.closeSidePanel);
let throughput: number;
@@ -79,7 +77,6 @@ export const AddDatabasePanel: FunctionComponent = ({
dataExplorerArea: Constants.Areas.ContextualPane,
};
TelemetryProcessor.trace(Action.CreateDatabase, ActionModifiers.Open, addDatabasePaneOpenMessage);
- buttonElement.focus();
}, []);
const onSubmit = () => {
diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx
index d13644bd7..b52593707 100644
--- a/src/Explorer/SplashScreen/SplashScreen.tsx
+++ b/src/Explorer/SplashScreen/SplashScreen.tsx
@@ -307,23 +307,16 @@ export class SplashScreen extends React.Component {
iconSrc: AddDatabaseIcon,
title: "New " + getDatabaseName(),
description: undefined,
- onClick: () => this.openAddDatabasePanel(),
+ onClick: () =>
+ useSidePanel
+ .getState()
+ .openSidePanel("New " + getDatabaseName(), ),
});
}
return items;
}
- private openAddDatabasePanel() {
- const newDatabaseButton = document.activeElement as HTMLElement;
- useSidePanel
- .getState()
- .openSidePanel(
- "New " + getDatabaseName(),
-
- );
- }
-
private decorateOpenCollectionActivity({ databaseId, collectionId }: MostRecentActivity.OpenCollectionItem) {
return {
iconSrc: NotebookIcon,