diff --git a/packages/grafana-runtime/src/components/DataSourcePicker.test.tsx b/packages/grafana-runtime/src/components/DataSourcePicker.test.tsx
index e41eaeaa4f0..bdd44487e7b 100644
--- a/packages/grafana-runtime/src/components/DataSourcePicker.test.tsx
+++ b/packages/grafana-runtime/src/components/DataSourcePicker.test.tsx
@@ -1,4 +1,4 @@
-import { render } from '@testing-library/react';
+import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import React from 'react';
@@ -24,5 +24,12 @@ describe('DataSourcePicker', () => {
select.getByLabelText('select-clear-value');
}).toThrowError();
});
+
+ it('should pass disabled prop', async () => {
+ render();
+
+ const input = screen.getByLabelText('Select a data source');
+ expect(input).toHaveProperty('disabled', true);
+ });
});
});
diff --git a/packages/grafana-runtime/src/components/DataSourcePicker.tsx b/packages/grafana-runtime/src/components/DataSourcePicker.tsx
index 0ceba9231be..b9ad9c2b761 100644
--- a/packages/grafana-runtime/src/components/DataSourcePicker.tsx
+++ b/packages/grafana-runtime/src/components/DataSourcePicker.tsx
@@ -47,6 +47,8 @@ export interface DataSourcePickerProps {
filter?: (dataSource: DataSourceInstanceSettings) => boolean;
onClear?: () => void;
invalid?: boolean;
+ disabled?: boolean;
+ isLoading?: boolean;
}
/**
@@ -162,7 +164,17 @@ export class DataSourcePicker extends PureComponent