Clearing the global search bar will reset suggestions (#88637) (#100046)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: James Rowe <jamesrowe08@gmail.com>
This commit is contained in:
Kibana Machine 2021-05-13 13:27:57 -04:00 committed by GitHub
parent e61080c312
commit facd1a4376
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 5 deletions

View file

@ -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 = () => {

View file

@ -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,