#1726 - add ability to type arbitrary values that aren't in items

This commit is contained in:
McGaelen 2024-03-25 15:58:19 -04:00
commit 9ac8e34241
4 changed files with 89 additions and 23 deletions

View file

@ -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",

View file

@ -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" />