From b321c4b406818aa569b8d80a9b959a9f2ae86f4a Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Fri, 22 Mar 2024 12:06:43 +0100 Subject: [PATCH] only start searching on enter and search button click (#28040) fixes: #27917 Signed-off-by: Erik Jan de Wit --- .../src/components/users/UserDataTableToolbarItems.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/js/apps/admin-ui/src/components/users/UserDataTableToolbarItems.tsx b/js/apps/admin-ui/src/components/users/UserDataTableToolbarItems.tsx index 39212b0925..3b9765eab4 100644 --- a/js/apps/admin-ui/src/components/users/UserDataTableToolbarItems.tsx +++ b/js/apps/admin-ui/src/components/users/UserDataTableToolbarItems.tsx @@ -97,16 +97,14 @@ export function UserDataTableToolbarItems({ placeholder={t("searchForUser")} aria-label={t("search")} value={searchUser} - onChange={(_, value) => { - setSearchUser(value); - }} - onSearch={() => { - setSearchUser(searchUser); + onSearch={(_, _v, attribute) => { + setSearchUser(attribute["haswords"]); refresh(); }} onKeyDown={(e) => { if (e.key === "Enter") { - setSearchUser(searchUser); + const target = e.target as HTMLInputElement; + setSearchUser(target.value); refresh(); } }}