diff --git a/src/Explorer/Panes/PanelContainerComponent.tsx b/src/Explorer/Panes/PanelContainerComponent.tsx index e6e4d1ade..6d5de0af2 100644 --- a/src/Explorer/Panes/PanelContainerComponent.tsx +++ b/src/Explorer/Panes/PanelContainerComponent.tsx @@ -78,15 +78,15 @@ export class PanelContainerComponent extends React.Component): void => { - const targetElementDataTest: string = useSelectedNode.getState().findSelectedCollection().id(); - const targetElement: HTMLElement = document.querySelector(`[data-test="${targetElementDataTest}"]`); + const targetElementDataTest: string | undefined = useSelectedNode.getState().findSelectedCollection().id(); + const targetElement: HTMLElement | null = document.querySelector(`[data-test="${targetElementDataTest}"]`); if (ev && (ev.target as HTMLElement).id === "notificationConsoleHeader") { ev.preventDefault(); } else { useSidePanel.getState().closeSidePanel(); } if (targetElement) { - const moreButton: HTMLElement = targetElement.querySelector('[name="More"]'); + const moreButton: HTMLElement | null = targetElement.querySelector('[name="More"]'); if (moreButton) { moreButton.focus(); }