diff --git a/src/assistant/Search/SearchBar.jsx b/src/assistant/Search/SearchBar.jsx index c4b376786..63f46a850 100644 --- a/src/assistant/Search/SearchBar.jsx +++ b/src/assistant/Search/SearchBar.jsx @@ -58,6 +58,7 @@ const SearchBar = () => { value={inputValue} onClick={handleClick} onKeyDown={handleKeyDown} + onClear={handleClear} onChange={handleChange} /> ) diff --git a/src/assistant/Search/SearchBarDesktop.jsx b/src/assistant/Search/SearchBarDesktop.jsx index 024797fa7..95f7317ec 100644 --- a/src/assistant/Search/SearchBarDesktop.jsx +++ b/src/assistant/Search/SearchBarDesktop.jsx @@ -1,5 +1,6 @@ import React, { useRef } from 'react' +import ClickAwayListener from 'cozy-ui/transpiled/react/ClickAwayListener' import SearchBar from 'cozy-ui/transpiled/react/SearchBar' import Icon from 'cozy-ui/transpiled/react/Icon' import { useI18n } from 'cozy-ui/transpiled/react/providers/I18n' @@ -11,29 +12,31 @@ import { useSearch } from './SearchProvider' import styles from './styles.styl' -const SearchBarDesktop = ({ value, onClick, onKeyDown, onChange }) => { +const SearchBarDesktop = ({ value, onClick, onKeyDown, onClear, onChange }) => { const { t } = useI18n() const { searchValue } = useSearch() const searchRef = useRef() return ( - <> - } - placeholder={t('assistant.search.placeholder')} - value={value} - componentsProps={{ - inputBase: { onKeyDown } - }} - disabledClear - disabledFocus={value !== ''} - onChange={onChange} - /> - {searchValue && } - + + + } + placeholder={t('assistant.search.placeholder')} + value={value} + componentsProps={{ + inputBase: { onKeyDown } + }} + disabledClear + disabledFocus={value !== ''} + onChange={onChange} + /> + {searchValue && } + + ) }