mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-30 17:37:01 +00:00
focus getting restored to more button on closing the delete collection dialog using close button
This commit is contained in:
parent
42e11d5160
commit
045d038a93
@ -1,4 +1,5 @@
|
||||
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";
|
||||
@ -77,11 +78,19 @@ export class PanelContainerComponent extends React.Component<PanelContainerProps
|
||||
}
|
||||
|
||||
private onDissmiss = (ev?: KeyboardEvent | React.SyntheticEvent<HTMLElement>): void => {
|
||||
const targetElementDataTest = useSelectedNode.getState().findSelectedCollection().id();
|
||||
const targetElement: HTMLElement = 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"]');
|
||||
if (moreButton) {
|
||||
moreButton.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private getPanelHeight = (): string => {
|
||||
|
Loading…
Reference in New Issue
Block a user