From a981ea22fb83849255d240e82a5a2ecbc01e036b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=A4ggmark?= Date: Thu, 14 Oct 2021 07:13:15 +0200 Subject: [PATCH] A11y: Fix fastpass issues for share modal (#40386) --- .../src/selectors/components.ts | 1 + public/app/core/components/Select/FolderPicker.tsx | 6 +++++- .../Select/__snapshots__/FolderPicker.test.tsx.snap | 1 + .../dashboard/components/ShareModal/ShareEmbed.tsx | 13 +++++++++---- .../AddLibraryPanelModal/AddLibraryPanelModal.tsx | 13 +++++++++++-- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/packages/grafana-e2e-selectors/src/selectors/components.ts b/packages/grafana-e2e-selectors/src/selectors/components.ts index ae23016feea..7267d46db99 100644 --- a/packages/grafana-e2e-selectors/src/selectors/components.ts +++ b/packages/grafana-e2e-selectors/src/selectors/components.ts @@ -203,6 +203,7 @@ export const Components = { }, FolderPicker: { container: 'Folder picker select container', + input: 'Select a folder', }, ReadonlyFolderPicker: { container: 'data-testid Readonly folder picker select container', diff --git a/public/app/core/components/Select/FolderPicker.tsx b/public/app/core/components/Select/FolderPicker.tsx index 9ee045e4b12..35aad433894 100644 --- a/public/app/core/components/Select/FolderPicker.tsx +++ b/public/app/core/components/Select/FolderPicker.tsx @@ -27,6 +27,8 @@ export interface Props { * initialFolderId needs to have an value > -1 or an error will be thrown. */ skipInitialLoad?: boolean; + /** The id of the search input. Use this to set a matching label with htmlFor */ + inputId?: string; } interface State { @@ -169,11 +171,13 @@ export class FolderPicker extends PureComponent { render() { const { folder } = this.state; - const { enableCreateNew } = this.props; + const { enableCreateNew, inputId } = this.props; return (
{ - +