Update PanelContainerComponent.tsx

This commit is contained in:
MokireddySampath 2023-10-11 13:39:11 +05:30 committed by GitHub
parent 1e5042c2ec
commit 832964f1b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,19 +78,27 @@ export class PanelContainerComponent extends React.Component<PanelContainerProps
}
private onDissmiss = (ev?: KeyboardEvent | React.SyntheticEvent<HTMLElement>): 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 => {