From 191ef7b2b8dbacb590b516242cad492eec2d1b51 Mon Sep 17 00:00:00 2001
From: Manoj Vivek
Date: Mon, 21 Nov 2022 11:28:08 +0530
Subject: [PATCH] FilterByFunction minor bug fix
---
.../shared/profile/src/ProfileView/FilterByFunctionButton.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/packages/shared/profile/src/ProfileView/FilterByFunctionButton.tsx b/ui/packages/shared/profile/src/ProfileView/FilterByFunctionButton.tsx
index 874fd78bb80..4b63d3d64c1 100644
--- a/ui/packages/shared/profile/src/ProfileView/FilterByFunctionButton.tsx
+++ b/ui/packages/shared/profile/src/ProfileView/FilterByFunctionButton.tsx
@@ -21,9 +21,9 @@ import {
import {useState} from 'react';
const FilterByFunctionButton = (): JSX.Element => {
- const [value, setValue] = useState('');
const dispatch = useAppDispatch();
const storeVal = useAppSelector(selectFilterByFunction);
+ const [value, setValue] = useState(storeVal ?? '');
const onAction = (): void => {
dispatch(setFilterByFunction(value));
@@ -35,7 +35,7 @@ const FilterByFunctionButton = (): JSX.Element => {
className="text-sm"
onAction={onAction}
onChange={e => setValue(e.target.value)}
- value={value ?? ''}
+ value={value}
onBlur={() => setValue(storeVal ?? '')}
/>
);