Update PanelContainerComponent.tsx

This commit is contained in:
MokireddySampath 2023-07-26 20:31:35 +05:30 committed by GitHub
parent 140313e5e3
commit fd50580ff7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,4 @@
import { IPanelProps, IRenderFunction, Panel, PanelType } from "@fluentui/react";
import { useSelectedNode } from "Explorer/useSelectedNode";
import * as React from "react";
import { useNotificationConsole } from "../../hooks/useNotificationConsole";
import { useSidePanel } from "../../hooks/useSidePanel";
@ -78,19 +77,11 @@ export class PanelContainerComponent extends React.Component<PanelContainerProps
}
private onDissmiss = (ev?: KeyboardEvent | React.SyntheticEvent<HTMLElement>): void => {
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 | null = targetElement.querySelector('[name="More"]');
if (moreButton) {
moreButton.focus();
}
}
};
private getPanelHeight = (): string => {