select
Description
fires when a new option is selected in a rich selectParameters
- ev - (object) a CustomEvent object. Its
detail
property contains:- selected - (object) an object with the newly selected option
Example
<script>
function handleSelect(ev) {
const newSelection = ev.detail;
console.log(newSelection);
//=>{selected:{id:97, name:'August Dvorak', email:'dvor.august@gmail.com', avatar:'august.jpg'}}
}
</script>
<RichSelect value={1} on:select={handleSelect}/>
Details
The handler function receives the object of the newly selected option.
Related article: Catching the change of selected option