Commit 36232857 by Alex Khomenko Committed by Arve Knudsen

Fix dashboard picker's props (#22815)

(cherry picked from commit 2fac8344)
parent 9d605bdd
......@@ -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>) {
......
......@@ -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}
/>
);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment