From 523a1178f24dcd06318b1a24791d25c15f695105 Mon Sep 17 00:00:00 2001 From: Kushal Kumar <59891164+K-Kumar-01@users.noreply.github.com> Date: Thu, 28 Jan 2021 22:23:30 +0530 Subject: [PATCH] Extended EuiFieldText in EuiSuggestInput (#4452) --- CHANGELOG.md | 1 + src/components/suggest/suggest_input.tsx | 35 ++++++++++++------------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6267ee9d34c..3b348a6ca65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Added `getDefaultEuiMarkdownProcessingPlugins` method for better control over `EuiMarkdownEditor`'s toolbar UI ([#4383](https://github.com/elastic/eui/pull/4383)) - Changed `EuiOutsideClickDetector` events to be standard event types ([#4434](https://github.com/elastic/eui/pull/4434)) +- Added `EuiFieldTextProps` in type definitions for `EuiSuggestInput` ([#4452](https://github.com/elastic/eui/pull/4452)) **Bug fixes** diff --git a/src/components/suggest/suggest_input.tsx b/src/components/suggest/suggest_input.tsx index 3781ada7642..1302be2c4e1 100644 --- a/src/components/suggest/suggest_input.tsx +++ b/src/components/suggest/suggest_input.tsx @@ -21,32 +21,33 @@ import React, { useState, FunctionComponent } from 'react'; import { CommonProps } from '../common'; import classNames from 'classnames'; -import { EuiFieldText } from '../form'; +import { EuiFieldText, EuiFieldTextProps } from '../form'; import { EuiToolTip } from '../tool_tip'; import { EuiIcon } from '../icon'; import { EuiInputPopover } from '../popover'; import { EuiSuggestItemProps } from './suggest_item'; -export type EuiSuggestInputProps = CommonProps & { - tooltipContent?: string; +export type EuiSuggestInputProps = CommonProps & + EuiFieldTextProps & { + tooltipContent?: string; - /** - * Status of the current query 'unsaved', 'saved', 'unchanged' or 'loading'. - */ - status?: 'unsaved' | 'saved' | 'unchanged' | 'loading'; + /** + * Status of the current query 'unsaved', 'saved', 'unchanged' or 'loading'. + */ + status?: 'unsaved' | 'saved' | 'unchanged' | 'loading'; - /** - * Element to be appended to the input bar. - */ - append?: JSX.Element; + /** + * Element to be appended to the input bar. + */ + append?: JSX.Element; - /** - * List of suggestions to display using 'suggestItem'. - */ - suggestions: JSX.Element[] | EuiSuggestItemProps[]; + /** + * List of suggestions to display using 'suggestItem'. + */ + suggestions: JSX.Element[] | EuiSuggestItemProps[]; - sendValue?: Function; -}; + sendValue?: Function; + }; interface Status { icon?: string;