budibase/packages/standard-components/src/Select.svelte

24 lines
383 B
Svelte
Raw Normal View History

<script>
2020-02-03 10:50:30 +01:00
export let value = ""
export let className = ""
2020-02-03 10:50:30 +01:00
export let _bb
2020-02-03 10:50:30 +01:00
let actualValue = ""
2020-02-25 16:21:23 +01:00
let selectElement
$: selectElement && _bb.attachChildren(selectElement)
2020-02-03 10:50:30 +01:00
const onchange = ev => {
if (_bb) {
2020-08-11 11:31:41 +02:00
_bb.setBinding("value", ev.target.value)
2020-02-03 10:50:30 +01:00
}
}
</script>
2020-02-25 16:21:23 +01:00
<select
class={className}
{value}
on:change={onchange}
bind:this={selectElement} />