# ContextMenuBeforeCloseEvent (@salmonui/buttons/menu)

> The ContextMenuBeforeCloseEvent interface of @salmonui/buttons/menu: onBeforeClose event; preventDefault() keeps the menu open.

Canonical: https://salmonui.dev/docs/reference/buttons/menu/ContextMenuBeforeCloseEvent

```ts
import type { ContextMenuBeforeCloseEvent } from '@salmonui/buttons/menu';
```

Entry index: https://salmonui.dev/docs/reference/buttons/menu (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/buttons/menu.md).

## Reference

Kind: interface

```ts
interface ContextMenuBeforeCloseEvent {
    readonly reason: MenuOpenChangeReason;
    readonly source: MenuSource;
    readonly defaultPrevented: boolean;
    preventDefault(): void;
}
```

`onBeforeClose` event; `preventDefault()` keeps the menu open.

Members (4):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `reason` | `readonly reason: MenuOpenChangeReason;` |  |  |
| `source` | `readonly source: MenuSource;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
