# ContextMenuBeforeOpenEvent (@salmonui/buttons/menu)

> The ContextMenuBeforeOpenEvent interface of @salmonui/buttons/menu: onBeforeOpen event; preventDefault() keeps the menu closed (and the browser menu shows).

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

```ts
import type { ContextMenuBeforeOpenEvent } 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 ContextMenuBeforeOpenEvent {
    readonly target: Element;
    readonly point: ContextMenuPoint;
    readonly source: ContextMenuSource;
    readonly defaultPrevented: boolean;
    preventDefault(): void;
}
```

`onBeforeOpen` event; `preventDefault()` keeps the menu closed (and the browser menu shows).

Members (5):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `target` | `readonly target: Element;` |  | The element the event happened on (the deepest target; filter with `closest`). |
| `point` | `readonly point: ContextMenuPoint;` |  |  |
| `source` | `readonly source: ContextMenuSource;` |  |  |
| `defaultPrevented` | `readonly defaultPrevented: boolean;` |  |  |
| `preventDefault` | `preventDefault(): void;` |  |  |
