onChange
Description
Fires when a new value is selected in a multicomboUsage
onChange?: (ev: { value: (string | number)[] }) => void;
Parameters
The callback of the event takes an object with the following parameter:
- value - an array with the previously and newly selected options' ids
Example
function handleChange({ value }: { value: (string | number)[] }) {
console.log(value);
// => [101, 104]
}
<MultiCombo options={users} onChange={handleChange} />
Details
The handler function receives an object with an array of the previously and newly selected options' ids.
Related article: Catching the change of selected options