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>({
|
export function SelectBase<T>({
|
||||||
allowCustomValue = false,
|
allowCustomValue = false,
|
||||||
|
allowCreateWhileLoading = false,
|
||||||
'aria-label': ariaLabel,
|
'aria-label': ariaLabel,
|
||||||
autoFocus = false,
|
autoFocus = false,
|
||||||
backspaceRemovesValue = true,
|
backspaceRemovesValue = true,
|
||||||
@ -227,6 +228,7 @@ export function SelectBase<T>({
|
|||||||
|
|
||||||
if (allowCustomValue) {
|
if (allowCustomValue) {
|
||||||
ReactSelectComponent = Creatable as any;
|
ReactSelectComponent = Creatable as any;
|
||||||
|
creatableProps.allowCreateWhileLoading = allowCreateWhileLoading;
|
||||||
creatableProps.formatCreateLabel = formatCreateLabel ?? ((input: string) => `Create: ${input}`);
|
creatableProps.formatCreateLabel = formatCreateLabel ?? ((input: string) => `Create: ${input}`);
|
||||||
creatableProps.onCreateOption = onCreateOption;
|
creatableProps.onCreateOption = onCreateOption;
|
||||||
creatableProps.isValidNewOption = isValidNewOption;
|
creatableProps.isValidNewOption = isValidNewOption;
|
||||||
|
@ -9,6 +9,7 @@ export type InputActionMeta = {
|
|||||||
export interface SelectCommonProps<T> {
|
export interface SelectCommonProps<T> {
|
||||||
/** Aria label applied to the input field */
|
/** Aria label applied to the input field */
|
||||||
['aria-label']?: string;
|
['aria-label']?: string;
|
||||||
|
allowCreateWhileLoading?: boolean;
|
||||||
allowCustomValue?: boolean;
|
allowCustomValue?: boolean;
|
||||||
/** Focus is set to the Select when rendered*/
|
/** Focus is set to the Select when rendered*/
|
||||||
autoFocus?: boolean;
|
autoFocus?: boolean;
|
||||||
|
@ -68,6 +68,7 @@ export const TagFilter: FC<Props> = ({
|
|||||||
const value = tags.map((tag) => ({ value: tag, label: tag, count: 0 }));
|
const value = tags.map((tag) => ({ value: tag, label: tag, count: 0 }));
|
||||||
|
|
||||||
const selectOptions = {
|
const selectOptions = {
|
||||||
|
allowCreateWhileLoading: true,
|
||||||
allowCustomValue,
|
allowCustomValue,
|
||||||
formatCreateLabel,
|
formatCreateLabel,
|
||||||
defaultOptions: true,
|
defaultOptions: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user