From 9fcaaa0d61cdd45d731cc6df7f6921218fa3733c Mon Sep 17 00:00:00 2001 From: Cee Chen <549407+cee-chen@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:13:21 -0700 Subject: [PATCH 1/3] Update renovate.json (#7972) --- renovate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renovate.json b/renovate.json index 835b79d032c..93c25ecb873 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,6 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["config:recommended", ":disableDependencyDashboard"], + "extends": ["config:recommended"], "ignorePaths": ["./.github/**"], "enabledManagers": ["npm"], "baseBranches": ["main"], From da774cfa200ed239bcc93f7e562e14397ca9d46b Mon Sep 17 00:00:00 2001 From: Alexey Antonov Date: Mon, 19 Aug 2024 23:32:13 +0300 Subject: [PATCH 2/3] [EuiFieldSearch] update clear button `aria-label` (#7970) Co-authored-by: Cee Chen --- packages/eui/changelogs/upcoming/7970.md | 3 + .../form/field_search/field_search.tsx | 74 +++++++++++-------- .../__snapshots__/search_bar.test.tsx.snap | 2 +- .../__snapshots__/selectable.test.tsx.snap | 2 +- .../selectable_search.test.tsx.snap | 2 +- 5 files changed, 49 insertions(+), 34 deletions(-) create mode 100644 packages/eui/changelogs/upcoming/7970.md diff --git a/packages/eui/changelogs/upcoming/7970.md b/packages/eui/changelogs/upcoming/7970.md new file mode 100644 index 00000000000..9ac2adfbed5 --- /dev/null +++ b/packages/eui/changelogs/upcoming/7970.md @@ -0,0 +1,3 @@ +**Accessibility** + +- Updated the `aria-label` attribute for the `EuiFieldSearch` clear button diff --git a/packages/eui/src/components/form/field_search/field_search.tsx b/packages/eui/src/components/form/field_search/field_search.tsx index 33bcc8e3348..850e2745947 100644 --- a/packages/eui/src/components/form/field_search/field_search.tsx +++ b/packages/eui/src/components/form/field_search/field_search.tsx @@ -9,13 +9,14 @@ import React, { Component, InputHTMLAttributes, KeyboardEvent } from 'react'; import classNames from 'classnames'; -import { Browser } from '../../../services/browser'; -import { CommonProps } from '../../common'; import { keys, withEuiStylesMemoizer, WithEuiStylesMemoizerProps, } from '../../../services'; +import { Browser } from '../../../services/browser'; +import { CommonProps } from '../../common'; +import { EuiI18n } from '../../i18n'; import { EuiFormControlLayout, @@ -256,36 +257,47 @@ export class EuiFieldSearchClass extends Component< ]; return ( - - - this.onKeyUp(e, incremental, onSearch)} - disabled={disabled} - ref={this.setRef} - {...rest} - /> - - + {(clearSearchButtonLabel: string) => ( + + + this.onKeyUp(e, incremental, onSearch)} + disabled={disabled} + ref={this.setRef} + {...rest} + /> + + + )} + ); } } diff --git a/packages/eui/src/components/search_bar/__snapshots__/search_bar.test.tsx.snap b/packages/eui/src/components/search_bar/__snapshots__/search_bar.test.tsx.snap index 2799498afc5..08c3a91eca2 100644 --- a/packages/eui/src/components/search_bar/__snapshots__/search_bar.test.tsx.snap +++ b/packages/eui/src/components/search_bar/__snapshots__/search_bar.test.tsx.snap @@ -119,7 +119,7 @@ exports[`SearchBar render - provided query, filters 1`] = ` class="euiFormControlLayoutIcons emotion-euiFormControlLayoutIcons-absolute-right" >