From cdeac2e8457c5dcb7837f00e5d33a7513962db29 Mon Sep 17 00:00:00 2001 From: mkummer225 <7843299+mkummer225@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:43:28 -0600 Subject: [PATCH] add 'clear' button when the search input has text --- gui/src/pages/history.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gui/src/pages/history.tsx b/gui/src/pages/history.tsx index 8344263e1..47744fd7f 100644 --- a/gui/src/pages/history.tsx +++ b/gui/src/pages/history.tsx @@ -348,22 +348,23 @@ function History() { onChange={(e) => setSearchTerm(e.target.value)} /> { - if (searchInputRef.current.value !== "*") { + if (searchInputRef.current.value === "") { searchInputRef.current.value = "*"; setSearchTerm("*"); + } else { + searchInputRef.current.value = ""; + setSearchTerm(""); } }} > - Show All + {searchTerm === "" ? "Show All" : "Clear"}