Fix dashboard picker's props (#22815)

This commit is contained in:
Alex Khomenko 2020-03-17 12:07:40 +02:00 committed by GitHub
parent 67fc251fef
commit 2fac834413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -15,6 +15,7 @@ export function MultiSelect<T>(props: MultiSelectCommonProps<T>) {
interface AsyncSelectProps<T> extends Omit<SelectCommonProps<T>, 'options'>, SelectAsyncProps<T> {
// AsyncSelect has options stored internally. We cannot enable plain values as we don't have access to the fetched options
value?: SelectableValue<T>;
invalid?: boolean;
}
export function AsyncSelect<T>(props: AsyncSelectProps<T>) {

View File

@ -12,6 +12,8 @@ export interface Props {
currentDashboard?: SelectableValue<number>;
size?: FormInputSize;
isClearable?: boolean;
invalid?: boolean;
disabled?: boolean;
}
const getDashboards = (query = '') => {
@ -29,7 +31,8 @@ export const DashboardPicker: FC<Props> = ({
currentDashboard,
size = 'md',
isClearable = false,
...rest
invalid,
disabled,
}) => {
const debouncedSearch = debounce(getDashboards, 300, {
leading: true,
@ -49,7 +52,8 @@ export const DashboardPicker: FC<Props> = ({
placeholder="Select dashboard"
noOptionsMessage="No dashboards found"
value={currentDashboard}
{...rest}
invalid={invalid}
disabled={disabled}
/>
);
};