We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05fa288 commit 826af6aCopy full SHA for 826af6a
src/script/page/LeftSidebar/panels/Conversations/ConversationHeader/ConversationHeader.tsx
@@ -17,7 +17,7 @@
17
*
18
*/
19
20
-import {useEffect, useRef} from 'react';
+import {KeyboardEvent, useEffect, useRef} from 'react';
21
22
import {amplify} from 'amplify';
23
@@ -84,6 +84,12 @@ export const ConversationHeader = ({
84
});
85
}, []);
86
87
+ function onKeyDown(event: KeyboardEvent<HTMLInputElement>) {
88
+ if (event.key === 'Escape') {
89
+ setSearchValue('');
90
+ }
91
92
+
93
return (
94
<>
95
<div css={header}>
@@ -107,6 +113,7 @@ export const ConversationHeader = ({
107
113
108
114
{showSearchInput && (
109
115
<Input
116
+ onKeyDown={onKeyDown}
110
117
ref={inputRef}
111
118
className="label-1"
112
119
value={searchValue}
0 commit comments