From 7330a138584087c87e0a8b92e42dd4b95225f679 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 12 Oct 2023 11:49:34 +0800 Subject: [PATCH] fix bugs --- src/pages/ProofSearch/SearchForm.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/pages/ProofSearch/SearchForm.js b/src/pages/ProofSearch/SearchForm.js index 569bc91..1aab6af 100644 --- a/src/pages/ProofSearch/SearchForm.js +++ b/src/pages/ProofSearch/SearchForm.js @@ -17,7 +17,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu }) => { const [type, setType] = React.useState([]); - const [status, setStatus] = React.useState({ key: 0, label: 'All', type: 'all' }); + const [status, setStatus] = React.useState(ComboData.proofStatus[0]); const [orgSelected, setOrgSelected] = React.useState({}); const [orgCombo, setOrgCombo] = React.useState(); const [issueSelected, setIssueSelected] = React.useState({}); @@ -66,7 +66,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu function resetForm() { setType([]); - setStatus({ key: 0, label: 'All', type: 'all' }); + setStatus(ComboData.proofStatus[0]); setOrgSelected({}); setIssueSelected({}); setGroupSelected({}); @@ -138,9 +138,7 @@ const SearchPublicNoticeForm = ({ applySearch, orgComboData, searchCriteria,issu inputValue={(issueSelected?.id) ? getIssueLabel(issueSelected) : ""} getOptionLabel={(option)=>getIssueLabel(option)} onChange={(event, newValue) => { - if (newValue !== null) { - setIssueSelected(newValue); - } + setIssueSelected(newValue); }} renderInput={(params) => ( option.label} onChange={(event, newValue) => { - if (newValue !== null) { - setGroupSelected(newValue); - } + setGroupSelected(newValue); }} renderInput={(params) => ( { - if (newValue !== null) { - setOrgSelected(newValue); - } + setOrgSelected(newValue); }} renderInput={(params) => (