mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-19 20:09:35 +00:00
feat(MultiSelect): add selectedOnly and combineValues props
The MultiSelect wasn't rendering form-submittable inputs. This fix adds two new props to help customize how the hidden inputs render. See #1742
This commit is contained in:
parent
cb40e8fb18
commit
276465aa9d
5 changed files with 167 additions and 44 deletions
17
types/MultiSelect/MultiSelect.svelte.d.ts
vendored
17
types/MultiSelect/MultiSelect.svelte.d.ts
vendored
|
@ -27,15 +27,30 @@ export interface MultiSelectProps extends RestProps {
|
|||
itemToString?: (item: MultiSelectItem) => any;
|
||||
|
||||
/**
|
||||
* Override the item name, title, labelText passed to the checkbox input
|
||||
* Override the item name, title, labelText, or value passed to the user-selectable checkbox input as well as the hidden inputs.
|
||||
* @default (item) => {}
|
||||
*/
|
||||
itemToInput?: (item: MultiSelectItem) => {
|
||||
name?: string;
|
||||
labelText?: any;
|
||||
title?: string;
|
||||
value?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set to `true` to only render selected options as hidden inputs for form submission.
|
||||
* @default false
|
||||
*/
|
||||
selectedOnly?: boolean;
|
||||
|
||||
/**
|
||||
* Combine selected items as comma-separated values when submitted in a form.
|
||||
* If set to `true`, the default separator is a comma `,`.
|
||||
* Pass in a string to override the separator.
|
||||
* @default false
|
||||
*/
|
||||
combineValues?: false | true | string;
|
||||
|
||||
/**
|
||||
* Set the selected ids
|
||||
* @default []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue