From 832964f1b998425caea9d72db3da38922d12b9c6 Mon Sep 17 00:00:00 2001 From: MokireddySampath <120497218+MokireddySampath@users.noreply.github.com> Date: Wed, 11 Oct 2023 13:39:11 +0530 Subject: [PATCH] Update PanelContainerComponent.tsx --- .../Panes/PanelContainerComponent.tsx | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Explorer/Panes/PanelContainerComponent.tsx b/src/Explorer/Panes/PanelContainerComponent.tsx index 642de0b3e..ec796bc97 100644 --- a/src/Explorer/Panes/PanelContainerComponent.tsx +++ b/src/Explorer/Panes/PanelContainerComponent.tsx @@ -78,19 +78,27 @@ export class PanelContainerComponent extends React.Component): void => { - const collection = useSelectedNode.getState().findSelectedCollection(); - const targetElement: HTMLElement | null = document.querySelector(`[data-test="${collection.id()}"]`); + let collection = useSelectedNode.getState().findSelectedCollection(); + if (collection) { + console.log(collection); + const targetElementDataTest: string | undefined = collection.id(); + const targetElement: HTMLElement | null = document.querySelector(`[data-test="${targetElementDataTest}"]`); + if (targetElement) { + setTimeout(() => { + const moreButton: HTMLElement | null = targetElement.querySelector('[name="More"]'); + if (moreButton) { + console.log(targetElementDataTest, targetElement); + moreButton.focus(); + } + }, 100); + clearTimeout; + } + } if (ev && (ev.target as HTMLElement).id === "notificationConsoleHeader") { ev.preventDefault(); } else { useSidePanel.getState().closeSidePanel(); } - if (targetElement) { - const moreButton: HTMLElement | null = targetElement.querySelector('[name="More"]'); - if (moreButton) { - moreButton.focus(); - } - } }; private getPanelHeight = (): string => {