Skip to main content

click

Description

fires on clicking an item of Action Menu or outside the menu

Parameters

Example

<script>
let message = "";
function clicked(ev){
const action = ev.detail.action;
message = action ? `clicked on ${action.id}` : "closed";
}
</script>

<ActionMenu {options} on:click={clicked} bind:handler={showMenu}/>
<Button type="primary" click={showMenu}>Click me</Button>

Details

You can get an object of the clicked option inside the event as in the above example. The detail property of the CustomEvent (ev.detail) will contain an object related to the clicked menu item.

Related article: Catching the change of a clicked option

Related sample: Action Menu