Merge branch '2262594' of https://github.com/Azure/cosmos-explorer into 2262594

This commit is contained in:
Sampath 2023-07-27 21:27:05 +05:30
commit bc9f617537

View File

@ -78,15 +78,16 @@ export class PanelContainerComponent extends React.Component<PanelContainerProps
} }
private onDissmiss = (ev?: KeyboardEvent | React.SyntheticEvent<HTMLElement>): void => { private onDissmiss = (ev?: KeyboardEvent | React.SyntheticEvent<HTMLElement>): void => {
const targetElementDataTest = useSelectedNode.getState().findSelectedCollection().id(); const collection = useSelectedNode.getState().findSelectedCollection();
const targetElement: HTMLElement = document.querySelector(`[data-test="${targetElementDataTest}"]`); const targetElementDataTest: string = collection.id();
const targetElement: HTMLElement | null = document.querySelector(`[data-test="${targetElementDataTest}"]`);
if (ev && (ev.target as HTMLElement).id === "notificationConsoleHeader") { if (ev && (ev.target as HTMLElement).id === "notificationConsoleHeader") {
ev.preventDefault(); ev.preventDefault();
} else { } else {
useSidePanel.getState().closeSidePanel(); useSidePanel.getState().closeSidePanel();
} }
if (targetElement) { if (targetElement) {
const moreButton: HTMLElement = targetElement.querySelector('[name="More"]'); const moreButton: HTMLElement | null = targetElement.querySelector('[name="More"]');
if (moreButton) { if (moreButton) {
moreButton.focus(); moreButton.focus();
} }