diff --git a/forms-flow-web/src/components/ServiceFlow/list/search/TaskFilterViewComponent.js b/forms-flow-web/src/components/ServiceFlow/list/search/TaskFilterViewComponent.js index 88a9c099ff..69b9864944 100644 --- a/forms-flow-web/src/components/ServiceFlow/list/search/TaskFilterViewComponent.js +++ b/forms-flow-web/src/components/ServiceFlow/list/search/TaskFilterViewComponent.js @@ -47,6 +47,8 @@ const TaskFilterViewComponent = React.memo( const dispatch = useDispatch(); const { t } = useTranslation(); const [assigneeOptions, setAssigneeOptions] = useState([]); + const [inputValuesPresent, setInputValuesPresent] = useState(false); // State to track any input value is present or not + const handleClick = (e) => { if (createSearchNode?.current?.contains(e.target)) { return; @@ -144,6 +146,16 @@ const TaskFilterViewComponent = React.memo( setDisplayFilter(false); }; + //To disable the show results & clear filter btn if there no input values + useEffect(() => { + setInputValuesPresent( + ( assignee || candidateGroup || processVariables?.length || dueStartDate || dueEndDate || + followStartDate || followEndDate || createdStartDate || createdEndDate || + priority || Object.keys(filterParams)?.length) + ); + }, [assignee, candidateGroup, processVariables, dueStartDate, dueEndDate, + followStartDate, followEndDate, createdStartDate, createdEndDate, priority]); + const clearAllFilters = () => { setAssignee(""); setCandidateGroup(""); @@ -427,18 +439,19 @@ const TaskFilterViewComponent = React.memo( - + -