Device manager - current session context menu (#9386)

* add destructive option and close on interaction options

* add kebab context menu wrapper

* use kebab context menu in current device section

* use named export

* lint

* sessionman tests
This commit is contained in:
Kerry 2022-10-13 09:07:34 +02:00 committed by GitHub
parent 8b54be6f48
commit 776ffa4764
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 468 additions and 108 deletions

View file

@ -92,6 +92,9 @@ export interface IProps extends IPosition {
// within an existing FocusLock e.g inside a modal.
focusLock?: boolean;
// call onFinished on any interaction with the menu
closeOnInteraction?: boolean;
// Function to be called on menu close
onFinished();
// on resize callback
@ -186,6 +189,10 @@ export default class ContextMenu extends React.PureComponent<IProps, IState> {
private onClick = (ev: React.MouseEvent) => {
// Don't allow clicks to escape the context menu wrapper
ev.stopPropagation();
if (this.props.closeOnInteraction) {
this.props.onFinished?.();
}
};
// We now only handle closing the ContextMenu in this keyDown handler.