Add information if an autocomplete option is arbitrary or not

Co-authored-by: Thomas Zerr<thomas.zerr@cloudogu.com>
Pushed-by: Thomas Zerr<thomas.zerr@cloudogu.com>
This commit is contained in:
Thomas Zerr
2024-11-21 13:15:25 +01:00
parent 05ff0910bf
commit 26b144ec77
2 changed files with 6 additions and 0 deletions

View File

@@ -53,6 +53,7 @@ function useAutocompleteOptions(
value: options.allowArbitraryValues(query),
label: query,
displayValue: t("form.combobox.arbitraryDisplayValue", { query }),
isArbitraryValue: true,
});
}
return result;

View File

@@ -21,4 +21,9 @@ export type Option<T> = {
* Takes precedence over the label in alternative selection modes (i.e. popups in combo-boxes).
*/
displayValue?: string;
/**
* If this flag is true, then the option value, does not actually exist in any data source. For example in the backend.
*/
isArbitraryValue?: boolean;
};