Skip to main content

select

Description

fires when a new option is selected in a combo

Parameters

  • ev - (object) a CustomEvent object. Its detail property contains:
    • selected - (object) an object of the newly selected option or null if the value is cleared

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>

<Combo value={1} on:select={handleSelect}/>

Details

The handler function receives an object of the newly selected option or null if the value is cleared.

Related article: Catching the change of the selected option