Skip to main content

select

Description

fires when a new date is selected in a date picker

Parameters

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

Example

<script>
function handleSelect(ev){
const newValue = ev.detail;
console.log(newValue);
// an object with the selected date
}
</script>

<DatePicker width="100%" on:select={handleSelect} />

Details

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

Related article: Catching the change of the selected date

Related sample: DatePicker