Skip to content

Commit

Permalink
Make it possible to close list using escape
Browse files Browse the repository at this point in the history
  • Loading branch information
jonandernovella committed Aug 1, 2022
1 parent 805d13a commit ea4fdae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frontend/src/components/QuickAdd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ export const QuickAdd = ({
return src;
};

const onEscapeInput = (e: any) => {
{
if (e.key === "Escape") {
setIsAutoCompleteVisible(false);
}
}
};

return (
<div className="advanced-search-container">
<h2> Add a new row</h2>
Expand All @@ -191,6 +199,7 @@ export const QuickAdd = ({
className={getSearchClasses()}
type="text"
min={0}
onKeyUp={(e) => onEscapeInput(e)}
onChange={(e) => {
setSearch({ ...search, text: e.target.value });
setIssue(null);
Expand Down

0 comments on commit ea4fdae

Please sign in to comment.