From 7f682d7b4f8b85950b166049628dd6334babfcf7 Mon Sep 17 00:00:00 2001 From: Melloware Date: Thu, 29 Sep 2022 08:43:02 -0400 Subject: [PATCH] Fix # #3387: Autocomplete add show/hide to ref (#3389) --- components/lib/autocomplete/AutoComplete.js | 2 ++ components/lib/autocomplete/autocomplete.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/components/lib/autocomplete/AutoComplete.js b/components/lib/autocomplete/AutoComplete.js index 9123a0a346..cf491c2e93 100644 --- a/components/lib/autocomplete/AutoComplete.js +++ b/components/lib/autocomplete/AutoComplete.js @@ -467,6 +467,8 @@ export const AutoComplete = React.memo( React.useImperativeHandle(ref, () => ({ props, search, + show, + hide, getElement: () => elementRef.current, getOverlay: () => overlayRef.current, getInput: () => inputRef.current, diff --git a/components/lib/autocomplete/autocomplete.d.ts b/components/lib/autocomplete/autocomplete.d.ts index d40c3a4b38..084468edec 100755 --- a/components/lib/autocomplete/autocomplete.d.ts +++ b/components/lib/autocomplete/autocomplete.d.ts @@ -110,6 +110,8 @@ export interface AutoCompleteProps extends Omit { + public show(): void; + public hide(): void; public search(event: React.SyntheticEvent, query: string, source: AutoCompleteSourceType): void; public getElement(): HTMLSpanElement; public getInput(): HTMLInputElement;