onchange
type OnChangeResult {
// Changed control item
item: {
id: string;
};
// New value of the control
value: any;
}
onchange(ev: OnChangeResult): void
event is triggered when the value of a control within the toolbar changes. This can be used to capture user input and respond accordingly.
Usage
Capturing control value change
<script>
const items = [
{ id: "name", comp: Text },
{ id: "email", comp: Text },
];
function handler(ev) {
const { item, value } = ev;
console.log("changed control", item.id);
console.log("new value", value);
}
</script>
<Toolbar {items} onchange={handler} />