Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components should emit consistent events #11

Open
michaelgaigg opened this issue Mar 30, 2021 · 1 comment
Open

Components should emit consistent events #11

michaelgaigg opened this issue Mar 30, 2021 · 1 comment

Comments

@michaelgaigg
Copy link

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

@thomas-lowry
Copy link
Owner

thomas-lowry commented Mar 31, 2021

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}/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants