<baht-multiselect>
Checkbox group; value is string[] in field.options order.
Basic
Events (name)
<baht-multiselect></baht-multiselect>
<script>
const el = document.querySelector('baht-multiselect');
el.field = {
"order": 1,
"type": "multiselect",
"key": "toppings",
"label": "Toppings",
"options": [
{
"key": "cheese",
"label": "Cheese"
},
{
"key": "bacon",
"label": "Bacon"
},
{
"key": "mushroom",
"label": "Mushroom"
}
]
};
el.value = [
"cheese"
];
</script>| Name | Type | Default | Description |
|---|---|---|---|
fieldJS | FieldDescriptor | — | Field spec: { order, type, key, label?, placeholder?, options?, … } |
valueJS | unknown | null | Controlled value. Re-feed on every baht-input |
disabled | boolean | false | Disable the control |
readonly | boolean | false | Read-only |
required | boolean | false | Show required mark |
show-optional | boolean | false | Append the localized "(optional)" marker to the label when not required (set by <baht-form show-optional>). |
errorJS | string | null | null | Validation message to display |
debounce | number | undefined | — | Debounce for typed edits (ms); unset = BahtFieldBase.defaultDebounce. |
Events
Section titled “Events”| Event | detail | Description |
|---|---|---|
name | CustomEvent | |
baht-input | { key, value } | Fired on every user edit |