mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: Allow addition of custom values whilst tags are loading (#40702)
This commit is contained in:
parent
740444680c
commit
447a088750
@ -88,6 +88,7 @@ const CustomControl = (props: any) => {
|
||||
|
||||
export function SelectBase<T>({
|
||||
allowCustomValue = false,
|
||||
allowCreateWhileLoading = false,
|
||||
'aria-label': ariaLabel,
|
||||
autoFocus = false,
|
||||
backspaceRemovesValue = true,
|
||||
@ -227,6 +228,7 @@ export function SelectBase<T>({
|
||||
|
||||
if (allowCustomValue) {
|
||||
ReactSelectComponent = Creatable as any;
|
||||
creatableProps.allowCreateWhileLoading = allowCreateWhileLoading;
|
||||
creatableProps.formatCreateLabel = formatCreateLabel ?? ((input: string) => `Create: ${input}`);
|
||||
creatableProps.onCreateOption = onCreateOption;
|
||||
creatableProps.isValidNewOption = isValidNewOption;
|
||||
|
@ -9,6 +9,7 @@ export type InputActionMeta = {
|
||||
export interface SelectCommonProps<T> {
|
||||
/** Aria label applied to the input field */
|
||||
['aria-label']?: string;
|
||||
allowCreateWhileLoading?: boolean;
|
||||
allowCustomValue?: boolean;
|
||||
/** Focus is set to the Select when rendered*/
|
||||
autoFocus?: boolean;
|
||||
|
@ -68,6 +68,7 @@ export const TagFilter: FC<Props> = ({
|
||||
const value = tags.map((tag) => ({ value: tag, label: tag, count: 0 }));
|
||||
|
||||
const selectOptions = {
|
||||
allowCreateWhileLoading: true,
|
||||
allowCustomValue,
|
||||
formatCreateLabel,
|
||||
defaultOptions: true,
|
||||
|
Loading…
Reference in New Issue
Block a user