Skip to content

Commit

Permalink
Clearing the global search bar will reset suggestions (elastic#88637) (
Browse files Browse the repository at this point in the history
…elastic#100046)

Co-authored-by: Kibana Machine <[email protected]>

Co-authored-by: James Rowe <[email protected]>
  • Loading branch information
kibanamachine and jamesrowe08 authored May 13, 2021
1 parent e61080c commit facd1a4
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 facd1a4

Please sign in to comment.