Skip to content

Commit

Permalink
Clearing the global search bar will reset suggestions (#88637)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
jamesrowe08 and kibanamachine committed May 13, 2021
1 parent bdde884 commit c4529fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ describe('SearchBar', () => {
};

const simulateTypeChar = async (text: string) => {
await waitFor(() =>
getSearchProps(component).onKeyUpCapture({ currentTarget: { value: text } })
);
await waitFor(() => getSearchProps(component).onInput({ currentTarget: { value: text } }));
};

const getDisplayedOptionsTitle = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,7 @@ export function SearchBar({
</EuiHeaderSectionItemButton>
}
searchProps={{
onKeyUpCapture: (e: React.KeyboardEvent<HTMLInputElement>) =>
setSearchValue(e.currentTarget.value),
onInput: (e: React.UIEvent<HTMLInputElement>) => setSearchValue(e.currentTarget.value),
'data-test-subj': 'nav-search-input',
inputRef: setSearchRef,
compressed: true,
Expand Down

0 comments on commit c4529fa

Please sign in to comment.