Skip to content

Commit 7b61149

Browse files
feat: Add dropdownOnly option to Text (#3683)
* feat: add dropdownOnly option * Update docs Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com> * fix formatting --------- Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
1 parent 8ef9dc7 commit 7b61149

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/extensibility/60-form-widgets.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ These are the available `Text` widget parameters:
4040
| **decodable** | No | boolean | Specifies that the field is base64-encoded and can be decoded in the UI. It can't be used together with **enum**. |
4141
| **decodedPlacehoder** | No | string | An optional alternative placeholder to use when the field is decoded. |
4242
| **disableOnEdit** | No | boolean | Disables a field in edit mode, defaults to `false`. Ignored if **readOnly** is set to `true`. |
43+
| **dropdownOnly** | No | boolean | Applicable only to inputs with a dropdown. When set to `true`, it restricts user input, allowing selection only from the predefined options. Defaults to `false`. |
4344

4445
See the following examples:
4546

src/components/Extensibility/components-form/StringRenderer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ export function StringRenderer({
8585
};
8686
});
8787

88-
return { input: Inputs.ComboboxInput, options: displayOptions };
88+
return {
89+
input: schema.get('dropdownOnly')
90+
? Inputs.Dropdown
91+
: Inputs.ComboboxInput,
92+
options: displayOptions,
93+
};
8994
} else if (!decodable) {
9095
return { input: Inputs.Text };
9196
} else {

0 commit comments

Comments
 (0)