mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 19:46:36 +00:00
Merge 9ac8e34241
into 338f651178
This commit is contained in:
commit
1e01f51387
4 changed files with 89 additions and 23 deletions
|
@ -1505,6 +1505,18 @@
|
|||
"constant": false,
|
||||
"reactive": true
|
||||
},
|
||||
{
|
||||
"name": "allowArbitraryValues",
|
||||
"kind": "let",
|
||||
"description": "Set to `true` to allow values that aren't included in `items`",
|
||||
"type": "boolean",
|
||||
"value": "false",
|
||||
"isFunction": false,
|
||||
"isFunctionDeclaration": false,
|
||||
"isRequired": false,
|
||||
"constant": false,
|
||||
"reactive": false
|
||||
},
|
||||
{
|
||||
"name": "direction",
|
||||
"kind": "let",
|
||||
|
|
|
@ -34,6 +34,19 @@ items={[
|
|||
{id: "2", text: "Fax"}
|
||||
]} />
|
||||
|
||||
## Arbitrary Values
|
||||
|
||||
Set `allowArbitraryValues` to `true` to allow the user to type in whatever value they want, even if it's not present in `items`.
|
||||
`selectedId` will be set to `undefined` when the value is arbitrary.
|
||||
|
||||
<ComboBox allowArbitraryValues titleText="Contact" placeholder="Select contact method"
|
||||
selectedId="1"
|
||||
items={[
|
||||
{id: "0", text: "Slack"},
|
||||
{id: "1", text: "Email"},
|
||||
{id: "2", text: "Fax"}
|
||||
]} />
|
||||
|
||||
## Reactive example
|
||||
|
||||
<FileSource src="/framed/ComboBox/ReactiveComboBox" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue