thomas-lowry / figma-plugin-ds-svelte

Figma Plugin DS components made with Svelte

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Components should emit consistent events

michaelgaigg opened this issue · comments

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

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