From 41f72032e268fecb3f42633e9aa98a6b100ad515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loix?= Date: Thu, 16 Jan 2020 12:46:54 +0530 Subject: [PATCH] [Mappings editor] Fix clear searchbox (#54880) --- .../document_fields/document_fields_header.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/index_management/public/app/components/mappings_editor/components/document_fields/document_fields_header.tsx b/x-pack/legacy/plugins/index_management/public/app/components/mappings_editor/components/document_fields/document_fields_header.tsx index a97e54afbf067..a4e746aa4037d 100644 --- a/x-pack/legacy/plugins/index_management/public/app/components/mappings_editor/components/document_fields/document_fields_header.tsx +++ b/x-pack/legacy/plugins/index_management/public/app/components/mappings_editor/components/document_fields/document_fields_header.tsx @@ -46,7 +46,15 @@ export const DocumentFieldsHeader = React.memo(({ searchValue, onSearchChange }: } )} value={searchValue} - onChange={e => onSearchChange(e.target.value)} + onChange={e => { + // Temporary fix until EUI fixes the contract + // See my comment https://github.com/elastic/eui/pull/2723/files#r366725059 + if (typeof e === 'string') { + onSearchChange(e); + } else { + onSearchChange(e.target.value); + } + }} aria-label={i18n.translate( 'xpack.idxMgmt.mappingsEditor.documentFields.searchFieldsAriaLabel', {