Components should emit consistent events
michaelgaigg opened this issue · comments
Michael Gaigg commented
At a minimum emit event.detail with attributes like value or checked, e.g. SelectMenu change event has event.detail.value but Checkbox change event does not transmit event.detail
Tom Lowry commented
Open to PRs on this if you have a use case where this is useful to you. In most cases cases I have just done this with Svelte's reactive declarations with values on those elements bound to variables.
Something like this
let menuItems = [{},{}];
let selectedItem;
$: selectedItem, functionName(); //run this when selectedItem changes
<SelectMenu bind:menuItems={menuItems} bind:value={selectedItem}/>