mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-08-09 02:36:40 +02:00
Clear text on command menu close
This commit is contained in:
@@ -58,6 +58,7 @@ export function CommandMenu() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
useOutsideClick(modalRef, () => {
|
useOutsideClick(modalRef, () => {
|
||||||
|
setSearchedText('');
|
||||||
setIsActive(false);
|
setIsActive(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -147,6 +148,7 @@ export function CommandMenu() {
|
|||||||
} else if (e.key === 'Tab') {
|
} else if (e.key === 'Tab') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
} else if (e.key === 'Escape') {
|
} else if (e.key === 'Escape') {
|
||||||
|
setSearchedText('');
|
||||||
setIsActive(false);
|
setIsActive(false);
|
||||||
} else if (e.key === 'Enter') {
|
} else if (e.key === 'Enter') {
|
||||||
const activePage = searchResults[activeCounter];
|
const activePage = searchResults[activeCounter];
|
||||||
|
Reference in New Issue
Block a user