onchange
Description
Fires when a new option is selected in a rich selectUsage
onchange?: (ev: { value: string | number }) => void;
Parameters
The callback of the event takes an object with the following parameter:
- value - (required) an id of the newly selected option
Example
<script>
function handleSelect({value}) {
console.log(value);
//an id of the newly selected option
}
</script>
<RichSelect onchange={handleSelect}/>
Details
The handler function receives an object with an id of the newly selected option.
Related article: Catching the change of selected option