['ref']
+ /** if this is defined clear button is always shown, like with search in chat */
+ extraCleanAction?: () => void
}) {
- const { onChange, value, className, id } = props
+ const { onChange, value, className, id, extraCleanAction } = props
const tx = useTranslationFunction()
return (
<>
@@ -44,7 +50,11 @@ export default function SearchInput(props: {
ref={props.inputRef}
spellCheck={false}
/>
-
+
>
)
}
diff --git a/src/renderer/components/chat/ChatList.tsx b/src/renderer/components/chat/ChatList.tsx
index 47cc5842dc..028421227c 100644
--- a/src/renderer/components/chat/ChatList.tsx
+++ b/src/renderer/components/chat/ChatList.tsx
@@ -320,12 +320,12 @@ export default function ChatList(props: {
displayName={searchChatInfo.name}
/>
{searchChatInfo.name}
-
+ */}
{translate_n('n_messages', messageResultIds.length)}
diff --git a/src/renderer/components/screens/MainScreen.tsx b/src/renderer/components/screens/MainScreen.tsx
index c1f560ae08..f4fba77ffd 100644
--- a/src/renderer/components/screens/MainScreen.tsx
+++ b/src/renderer/components/screens/MainScreen.tsx
@@ -227,6 +227,9 @@ export default function MainScreen() {
value={queryStr}
className='icon-rotated'
inputRef={searchRef}
+ extraCleanAction={
+ queryChatId ? () => setQueryChatId(null) : undefined
+ }
/>
)}