Skip to main content

click

type OnClickResult {
// clicked control item
item: {
id: string;
};
}

onclick(ev: OnClickResult): void

event occurs when a control within the toolbar is clicked. It can be used to identify which control was activated by the user.

Usage

Handling control click events

<script>
const items = [
{ id: "name", comp: "button" },
{ id: "email", comp: "button" },
];

function handler(ev) {
const { item } = ev;
console.log("clicked control", item.id);
}
</script>

<Toolbar {items} onclick={handler} />