This commit is contained in:
Gaelen McIntee 2024-08-08 19:44:54 +00:00 committed by GitHub
commit 1e01f51387
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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" />